Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check for NPC on ownedby condition
Added a check to Keen's mysterious NPC Identity list, since NPCs cannot be found with MySession.Static.Players.TryGetPlayerById
  • Loading branch information
SplenectomY authored Aug 23, 2018
commit bdb0c66db7719ebc5a0f29463693f647ec9b547d
10 changes: 8 additions & 2 deletions Essentials/Commands/CleanupModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,15 @@ public bool OwnedBy(MyCubeGrid grid, string str)
{
var player = Utilities.GetPlayerByNameOrId(str);
if (player == null)
return false;

{
if(MySession.Static.Players.IdentityIsNpc(identityId))
{
return grid.BigOwners.Contains(identityId);
}
else return false;

identityId = player.IdentityId;
}
}

return grid.BigOwners.Contains(identityId);
Expand Down