Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives
This commit is contained in:
@@ -264,7 +264,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||
wp->UpdateVirtCoord();
|
||||
|
||||
const StationSpec *spec = StationClass::Get(spec_class)->GetSpec(spec_index);
|
||||
byte *layout_ptr = AllocaM(byte, count);
|
||||
byte *layout_ptr = new byte[count];
|
||||
if (spec == nullptr) {
|
||||
/* The layout must be 0 for the 'normal' waypoints by design. */
|
||||
memset(layout_ptr, 0, count);
|
||||
@@ -291,6 +291,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||
YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
|
||||
}
|
||||
DirtyCompanyInfrastructureWindows(wp->owner);
|
||||
delete[] layout_ptr;
|
||||
}
|
||||
|
||||
return cost;
|
||||
|
Reference in New Issue
Block a user