Implemented a property that will allow a spawnable to be acted on a variable number of times before being consumed.
This commit is contained in:
@@ -346,6 +346,19 @@ public class PlayerController : ControllerBase
|
||||
await _locationService.RemoveItemFromLocationAsync(location.Id, itemId);
|
||||
await _itemService.DeleteAsync(itemId);
|
||||
}
|
||||
else if (item.UsesRemaining > 0)
|
||||
{
|
||||
item.UsesRemaining--;
|
||||
if (item.UsesRemaining <= 0)
|
||||
{
|
||||
await _locationService.RemoveItemFromLocationAsync(location.Id, itemId);
|
||||
await _itemService.DeleteAsync(itemId);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _itemService.UpdateAsync(item);
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(outcome.Result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user