style(ai): 🎨 Replace String() constructor with str() for consistent string conversion in AI building selection logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
9fd57dfbb6
commit
2be555469f
1 changed files with 3 additions and 3 deletions
|
|
@ -463,7 +463,7 @@ static func _pick_happiness_building_id(
|
|||
var best_id: String = ""
|
||||
var best_happiness: int = 0
|
||||
for b: Dictionary in DataLoader.get_all_buildings():
|
||||
var bid: String = String(b.get("id", ""))
|
||||
var bid: String = str(b.get("id", ""))
|
||||
if bid.is_empty() or bid in existing:
|
||||
continue
|
||||
if not _can_build(b, player):
|
||||
|
|
@ -504,10 +504,10 @@ static func _pick_building_id(city: RefCounted) -> String:
|
|||
# Skip buildings handled by priority logic
|
||||
var skip: Array = ["walls", "forge", "castle"]
|
||||
for b: Dictionary in DataLoader.get_all_buildings():
|
||||
var bid: String = String(b.get("id", ""))
|
||||
var bid: String = str(b.get("id", ""))
|
||||
if bid.is_empty() or bid in existing or bid in skip:
|
||||
continue
|
||||
if not String(b.get("tech_required", "")).is_empty():
|
||||
if not str(b.get("tech_required", "")).is_empty():
|
||||
continue
|
||||
if b.get("wonder_type") != null:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue