Fixed crash if puds contain a platform without oil-patch below.
This commit is contained in:
parent
b67184cf6e
commit
9badbd20c8
1 changed files with 8 additions and 6 deletions
|
@ -511,12 +511,14 @@ global void PlaceUnit(Unit* unit,int x,int y)
|
|||
if( type->GivesOil ) {
|
||||
Unit* temp;
|
||||
|
||||
DebugLevel0Fn("Remove oil-patch\n");
|
||||
temp=OilPatchOnMap(x,y);
|
||||
DebugCheck( !temp );
|
||||
unit->Value=temp->Value;
|
||||
// oil patch should NOT make sound, handled by let unit die
|
||||
LetUnitDie(temp); // Destroy oil patch
|
||||
if( (temp=OilPatchOnMap(x,y)) ) {
|
||||
DebugCheck( !temp );
|
||||
unit->Value=temp->Value;
|
||||
// oil patch should NOT make sound, handled by let unit die
|
||||
LetUnitDie(temp); // Destroy oil patch
|
||||
} else {
|
||||
DebugLevel0Fn("No oil-patch to remove.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue