diff --git a/src/races/races.c b/src/races/races.c index 519a51940..cc3e9ea56 100644 --- a/src/races/races.c +++ b/src/races/races.c @@ -69,8 +69,8 @@ static void equip_newunits(const struct equipment *eq, struct unit *u) if (btype != NULL) { building *b = new_building(btype, r, u->faction->locale); b->size = 10; - u->building = b; - fset(u, UFL_OWNER); + u_set_building(u, b); + building_set_owner(b, u); } } break; diff --git a/src/spells/spells.c b/src/spells/spells.c index 9894c43d0..74d702572 100644 --- a/src/spells/spells.c +++ b/src/spells/spells.c @@ -4438,7 +4438,7 @@ int sp_icastle(castorder * co) if (mage->region == r) { if (leave(mage, false)) { - mage->building = b; + u_set_building(mage, b); } }