Fixed bug: units in buildings are removed doubled from the map.

This commit is contained in:
johns 2000-06-09 14:03:48 +00:00
parent 1ec2e4d0ba
commit 99134da1b6

View file

@ -9,11 +9,10 @@
// FreeCraft - A free fantasy real time strategy game engine
//
/**@name unit.c - The units. */
/*
** (c) Copyright 1998-2000 by Lutz Sammer
**
** $Id$
*/
//
// (c) Copyright 1998-2000 by Lutz Sammer
//
// $Id$
//@{
@ -30,7 +29,6 @@
#include "freecraft.h"
#include "video.h"
#include "sound_id.h"
#include "unitsound.h"
#include "unittype.h"
#include "player.h"
@ -480,6 +478,10 @@ global void RemoveUnit(Unit* unit)
int w;
const UnitType* type;
if( unit->Removed ) { // could happen!
// If unit is removed (inside) and building is destroyed.
return;
}
unit->Removed=1;
// Remove unit from the current selection