Codechange: replace 'new PoolItem(...' with 'PoolItem::Create(...'

This commit is contained in:
Rubidium
2026-01-03 16:04:32 +01:00
committed by rubidium42
parent bc842811fc
commit 2fcd4e189a
49 changed files with 162 additions and 114 deletions
+14 -14
View File
@@ -569,8 +569,8 @@ static bool DisasterTick_Big_Ufo(DisasterVehicle *v)
delete v;
return false;
}
DisasterVehicle *u = new DisasterVehicle(-6 * (int)TILE_SIZE, v->y_pos, DIR_SW, ST_BIG_UFO_DESTROYER, v->index);
DisasterVehicle *w = new DisasterVehicle(-6 * (int)TILE_SIZE, v->y_pos, DIR_SW, ST_BIG_UFO_DESTROYER_SHADOW);
DisasterVehicle *u = DisasterVehicle::Create(-6 * (int)TILE_SIZE, v->y_pos, DIR_SW, ST_BIG_UFO_DESTROYER, v->index);
DisasterVehicle *w = DisasterVehicle::Create(-6 * (int)TILE_SIZE, v->y_pos, DIR_SW, ST_BIG_UFO_DESTROYER_SHADOW);
u->SetNext(w);
} else if (v->state == 0) {
int x = TileX(v->dest_tile) * TILE_SIZE;
@@ -743,9 +743,9 @@ static void Disaster_Zeppeliner_Init()
}
}
DisasterVehicle *v = new DisasterVehicle(x, 0, DIR_SE, ST_ZEPPELINER);
DisasterVehicle *v = DisasterVehicle::Create(x, 0, DIR_SE, ST_ZEPPELINER);
/* Allocate shadow */
DisasterVehicle *u = new DisasterVehicle(x, 0, DIR_SE, ST_ZEPPELINER_SHADOW);
DisasterVehicle *u = DisasterVehicle::Create(x, 0, DIR_SE, ST_ZEPPELINER_SHADOW);
v->SetNext(u);
}
@@ -759,11 +759,11 @@ static void Disaster_Small_Ufo_Init()
if (!Vehicle::CanAllocateItem(2)) return;
int x = TileX(RandomTile()) * TILE_SIZE + TILE_SIZE / 2;
DisasterVehicle *v = new DisasterVehicle(x, 0, DIR_SE, ST_SMALL_UFO);
DisasterVehicle *v = DisasterVehicle::Create(x, 0, DIR_SE, ST_SMALL_UFO);
v->dest_tile = TileXY(Map::SizeX() / 2, Map::SizeY() / 2);
/* Allocate shadow */
DisasterVehicle *u = new DisasterVehicle(x, 0, DIR_SE, ST_SMALL_UFO_SHADOW);
DisasterVehicle *u = DisasterVehicle::Create(x, 0, DIR_SE, ST_SMALL_UFO_SHADOW);
v->SetNext(u);
}
@@ -788,8 +788,8 @@ static void Disaster_Airplane_Init()
int x = (Map::SizeX() + 9) * TILE_SIZE - 1;
int y = TileY(found->location.tile) * TILE_SIZE + 37;
DisasterVehicle *v = new DisasterVehicle(x, y, DIR_NE, ST_AIRPLANE);
DisasterVehicle *u = new DisasterVehicle(x, y, DIR_NE, ST_AIRPLANE_SHADOW);
DisasterVehicle *v = DisasterVehicle::Create(x, y, DIR_NE, ST_AIRPLANE);
DisasterVehicle *u = DisasterVehicle::Create(x, y, DIR_NE, ST_AIRPLANE_SHADOW);
v->SetNext(u);
}
@@ -813,11 +813,11 @@ static void Disaster_Helicopter_Init()
int x = -16 * (int)TILE_SIZE;
int y = TileY(found->location.tile) * TILE_SIZE + 37;
DisasterVehicle *v = new DisasterVehicle(x, y, DIR_SW, ST_HELICOPTER);
DisasterVehicle *u = new DisasterVehicle(x, y, DIR_SW, ST_HELICOPTER_SHADOW);
DisasterVehicle *v = DisasterVehicle::Create(x, y, DIR_SW, ST_HELICOPTER);
DisasterVehicle *u = DisasterVehicle::Create(x, y, DIR_SW, ST_HELICOPTER_SHADOW);
v->SetNext(u);
DisasterVehicle *w = new DisasterVehicle(x, y, DIR_SW, ST_HELICOPTER_ROTORS);
DisasterVehicle *w = DisasterVehicle::Create(x, y, DIR_SW, ST_HELICOPTER_ROTORS);
u->SetNext(w);
}
@@ -831,11 +831,11 @@ static void Disaster_Big_Ufo_Init()
int x = TileX(RandomTile()) * TILE_SIZE + TILE_SIZE / 2;
int y = Map::MaxX() * TILE_SIZE - 1;
DisasterVehicle *v = new DisasterVehicle(x, y, DIR_NW, ST_BIG_UFO);
DisasterVehicle *v = DisasterVehicle::Create(x, y, DIR_NW, ST_BIG_UFO);
v->dest_tile = TileXY(Map::SizeX() / 2, Map::SizeY() / 2);
/* Allocate shadow */
DisasterVehicle *u = new DisasterVehicle(x, y, DIR_NW, ST_BIG_UFO_SHADOW);
DisasterVehicle *u = DisasterVehicle::Create(x, y, DIR_NW, ST_BIG_UFO_SHADOW);
v->SetNext(u);
}
@@ -859,7 +859,7 @@ static void Disaster_Submarine_Init(DisasterSubType subtype)
}
if (!IsWaterTile(TileVirtXY(x, y))) return;
new DisasterVehicle(x, y, dir, subtype);
DisasterVehicle::Create(x, y, dir, subtype);
}
/* Curious submarine #1, just floats around */