Setting last claimer properly during claim.

This commit is contained in:
2023-01-19 17:32:11 -05:00
parent 49af4b8920
commit cbd9021cfa
2 changed files with 5 additions and 14 deletions
@@ -28,12 +28,15 @@ public class ClaimMinePowerAction extends AbstractPowerAction {
@Override
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
if (source == null || awo == null)
return;
if (!(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
return;
PlayerCharacter playerCharacter = (PlayerCharacter) source;
if (!(awo.getObjectType().equals(Enum.GameObjectType.Building)))
return;
@@ -47,7 +50,7 @@ public class ClaimMinePowerAction extends AbstractPowerAction {
if (mine == null)
return;
if (mine.claimMine((PlayerCharacter) source) == true)
if (mine.claimMine(playerCharacter) == true)
ChatManager.sendSystemMessage( (PlayerCharacter) source, "You successfully claimed this mine..");
else
ChatManager.sendSystemMessage( (PlayerCharacter) source, "Your attempt for to claim this mine failed.");