fix gangwar server crash

This commit is contained in:
hydrant
2021-05-16 14:47:33 +02:00
parent 5a6ccf4991
commit 28dfca0034

View File

@@ -280,7 +280,7 @@ namespace ReallifeGamemode.Server.Gangwar
a.TriggerEvent("CLIENT:loose"); a.TriggerEvent("CLIENT:loose");
} }
ownerFaction.BankAccount.Balance += 15000; ownerFaction.BankAccount.Balance += 15000;
logger.LogInformation("Gang {0} successfully defended the turf {1} against gang {2} and gained {3} dollars", getOwner(), getAttacker(), 15000); logger.LogInformation("Gang {0} successfully defended the turf {1} against gang {2} and gained {3} dollars", getOwner(), getName(), getAttacker(), 15000);
} }
else if (getOwner() != FactionName) else if (getOwner() != FactionName)
{ {
@@ -297,7 +297,7 @@ namespace ReallifeGamemode.Server.Gangwar
if (a != null) if (a != null)
a.TriggerEvent("CLIENT:win"); a.TriggerEvent("CLIENT:win");
} }
logger.LogInformation("Gang {0} successfully took over the turf {1} from gang {2} and gained {3} dollars", getAttacker(), getOwner(), 10000); logger.LogInformation("Gang {0} successfully took over the turf {1} from gang {2} and gained {3} dollars", getAttacker(), getName(), getOwner(), 10000);
this.Owner = FactionName; this.Owner = FactionName;
attackerFaction.BankAccount.Balance += 10000; attackerFaction.BankAccount.Balance += 10000;
Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault(); Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault();