#ifdef NEW_UNIT inserted.

This commit is contained in:
johns 2000-05-09 12:27:37 +00:00
parent 2c75bdde35
commit 46794c5ac4
2 changed files with 6 additions and 0 deletions

View file

@ -181,9 +181,11 @@ global void HandleActionBoard(Unit* unit)
if( i==-1 ) {
if( ++unit->SubAction==200 ) {
unit->Command.Action=UnitActionStill;
#ifdef NEW_UNIT
if( unit->Command.Data.Move.Goal ) {
--unit->Command.Data.Move.Goal->Refs;
}
#endif
unit->SubAction=0;
}
} else {

View file

@ -250,6 +250,7 @@ local int ReturnWithWood(Unit* unit)
// Target is dead, stop harvest
//
if( destu ) {
#ifdef NEW_UNIT
if( destu->Destroyed ) {
DebugLevel0(__FUNCTION__": destroyed unit\n");
if( !--destu->Refs ) {
@ -270,9 +271,12 @@ local int ReturnWithWood(Unit* unit)
unit->Command.Data.Move.Goal=NoUnitP;
--destu->Refs;
}
#else
// FIXME: stored target not used!
#endif
x=unit->Command.Data.Move.DX;
y=unit->Command.Data.Move.DY;
destu=WoodDepositOnMap(x,y);