Changes the interaction system so that if a client sends a UseItemInHand input command while not having a valid attached entity, the handler method will block the command. Previously, the handler method would throw a NullRefException if this occurred.
This commit is contained in:
parent
deb2b984eb
commit
6ca9e16670
1 changed files with 5 additions and 0 deletions
|
|
@ -261,6 +261,11 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||
|
||||
var userEntity = ((IPlayerSession) session).AttachedEntity;
|
||||
|
||||
if (userEntity == null || !userEntity.IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (userEntity.TryGetComponent(out CombatModeComponent combatMode) && combatMode.IsInCombatMode)
|
||||
{
|
||||
DoAttack(userEntity, coords, uid);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue