fixing enemy territory claim bug
This commit is contained in:
@@ -1082,7 +1082,7 @@ func _on_move_units_request_completed(result: int, response_code: int, _headers:
|
|||||||
|
|
||||||
_clear_selected_archers()
|
_clear_selected_archers()
|
||||||
coordinate_label.text = "Archer squad moved."
|
coordinate_label.text = "Archer squad moved."
|
||||||
_refresh_player_state()
|
_load_visible_locations()
|
||||||
|
|
||||||
|
|
||||||
func _claim_selected_tile() -> void:
|
func _claim_selected_tile() -> void:
|
||||||
|
|||||||
@@ -278,8 +278,14 @@ public class UnitTrainingService
|
|||||||
return;
|
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(
|
await _locations.UpdateOneAsync(
|
||||||
x => x.Id == target.Id && (x.BuildingType == null || x.BuildingType == ""),
|
emptyBuildingFilter,
|
||||||
Builders<Location>.Update
|
Builders<Location>.Update
|
||||||
.Set(x => x.OwnerUsername, username)
|
.Set(x => x.OwnerUsername, username)
|
||||||
.Set(x => x.Kind, "Claimed")
|
.Set(x => x.Kind, "Claimed")
|
||||||
|
|||||||
Reference in New Issue
Block a user