Add map_scr_remove_spatial
This commit is contained in:
parent
8329d2fcf6
commit
cba1fc8f61
|
@ -7,6 +7,41 @@
|
|||
|
||||
namespace fallout {
|
||||
|
||||
// 0x49B170
|
||||
int map_scr_remove_spatial(int tile, int elevation)
|
||||
{
|
||||
Script* scr;
|
||||
Object* obj;
|
||||
Rect rect;
|
||||
|
||||
scr = scriptGetFirstSpatialScript(elevation);
|
||||
while (scr != NULL) {
|
||||
if (builtTileGetTile(scr->sp.built_tile) == tile) {
|
||||
scriptRemove(scr->sid);
|
||||
|
||||
scr = scriptGetFirstSpatialScript(elevation);
|
||||
continue;
|
||||
}
|
||||
|
||||
scr = scriptGetNextSpatialScript();
|
||||
}
|
||||
|
||||
obj = objectFindFirstAtElevation(elevation);
|
||||
while (obj != NULL) {
|
||||
if (obj->tile == tile && buildFid(OBJ_TYPE_INTERFACE, 3, 0, 0, 0) == obj->fid) {
|
||||
objectDestroy(obj, &rect);
|
||||
tileWindowRefreshRect(&rect, elevation);
|
||||
|
||||
obj = objectFindFirstAtElevation(elevation);
|
||||
continue;
|
||||
}
|
||||
|
||||
obj = objectFindNextAtElevation();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x49B214
|
||||
int map_scr_remove_all_spatials()
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
namespace fallout {
|
||||
|
||||
int map_scr_remove_spatial(int tile, int elevation);
|
||||
int map_scr_remove_all_spatials();
|
||||
|
||||
} // namespace fallout
|
||||
|
|
Loading…
Reference in New Issue