fixing enemy territory claim bug
This commit is contained in:
@@ -278,8 +278,14 @@ public class UnitTrainingService
|
||||
return;
|
||||
}
|
||||
|
||||
var emptyBuildingFilter = Builders<Location>.Filter.And(
|
||||
Builders<Location>.Filter.Eq(x => x.Id, target.Id),
|
||||
Builders<Location>.Filter.Or(
|
||||
Builders<Location>.Filter.Eq(x => x.BuildingType, null),
|
||||
Builders<Location>.Filter.Eq(x => x.BuildingType, "")));
|
||||
|
||||
await _locations.UpdateOneAsync(
|
||||
x => x.Id == target.Id && (x.BuildingType == null || x.BuildingType == ""),
|
||||
emptyBuildingFilter,
|
||||
Builders<Location>.Update
|
||||
.Set(x => x.OwnerUsername, username)
|
||||
.Set(x => x.Kind, "Claimed")
|
||||
|
||||
Reference in New Issue
Block a user