Fix solid check position for earthquakes launched from local calls

The effect is created in global coordinates, but the SemiSolidCheck was done in local coordinates.
ipv6
Sven Eberhardt 2016-12-27 07:49:20 -04:00
parent 308fc37e47
commit 93109e60f5
1 changed files with 2 additions and 2 deletions

View File

@ -43,11 +43,11 @@ func FxIntEarthquakeControlSaveScen(obj, fx, props)
return true;
}
// Launches an earthquake with epicenter (x,y).
// Launches an earthquake with epicenter (x,y) in global coordinates.
global func LaunchEarthquake(int x, int y, int strength)
{
// Earthquake should start in solid.
if (!GBackSemiSolid(x, y))
if (!GBackSemiSolid(x - GetX(), y - GetY()))
return false;
// Minimum strength is 15, maximum strength is 100.
strength = BoundBy(strength, 15, 100);