NEW_ORDERS are now only supported, old code removed.

This commit is contained in:
johns 2001-03-25 23:55:52 +00:00
parent acb8598330
commit 3a2d4a75d4
3 changed files with 3 additions and 39 deletions

View file

@ -404,11 +404,7 @@ global void MapUpdateVisible(void)
// This is not a big deal as far as only mines are
// concerned, but for more units (like parasited ones
// in *craft), maybe we should create a dedicated queue...
#ifdef NEW_ORDERS
if( unit->Orders[0].Action==UnitActionMineGold ) {
#else
if( unit->Command.Action==UnitActionMineGold ) {
#endif
mine=GoldMineOnMap(unit->X,unit->Y);
if( mine ) { // Somtimes, the peon is at home :).
#ifdef NEW_FOW

View file

@ -850,18 +850,11 @@ global int NewPath(Unit* unit,int* xdp,int* ydp)
x=unit->X;
y=unit->Y;
#ifdef NEW_ORDERS
goal=unit->Orders[0].Goal;
gx=unit->Orders[0].X;
gy=unit->Orders[0].Y;
rx=unit->Orders[0].RangeX;
ry=unit->Orders[0].RangeY;
#else
goal=unit->Command.Data.Move.Goal;
gx=unit->Command.Data.Move.DX;
gy=unit->Command.Data.Move.DY;
rx=ry=unit->Command.Data.Move.Range;
#endif
DebugLevel3Fn("%Zd: -> %s %p | %dx%d+%d+%d\n"
,UnitNumber(unit),unit->Command.Data.Move.Fast ? "F" : "C"
@ -873,17 +866,10 @@ global int NewPath(Unit* unit,int* xdp,int* ydp)
// A new path should always have the fast flag set.
//
if( unit->Goal!=goal || unit->GoalX!=gx || unit->GoalY!=gy ) {
#ifdef NEW_ORDERS
if( !unit->Data.Move.Fast ) {
DebugLevel0Fn("ResetPath missing\n");
abort();
}
#else
if( !unit->Command.Data.Move.Fast ) {
DebugLevel0Fn("ResetPath missing\n");
abort();
}
#endif
unit->Goal=goal;
unit->GoalX=gx;
unit->GoalY=gy;
@ -924,33 +910,21 @@ global int NewPath(Unit* unit,int* xdp,int* ydp)
*xdp=*ydp=0;
return PF_UNREACHABLE;
}
#ifdef NEW_ORDERS
unit->Data.Move.Fast=1; // this could be handled fast
#else
unit->Command.Data.Move.Fast=1; // this could be handled fast
#endif
}
}
//
// If possible, try fast.
//
#ifdef NEW_ORDERS
if( 0 && unit->Data.Move.Fast ) {
#else
if( 0 && unit->Command.Data.Move.Fast ) {
#endif
if( unit->Data.Move.Fast ) {
if( (i=FastNewPath(unit,gx,gy,rx,ry,xdp,ydp))>=-1 ) {
// Fast works
DebugCheck( *xdp==0 && *ydp==0 );
return i;
}
DebugLevel3Fn("Fallback to slow method\n");
#ifdef NEW_ORDERS
unit->Data.Move.Fast=0;
#else
unit->Command.Data.Move.Fast=0;
#endif
}
//

View file

@ -737,15 +737,9 @@ global int SpellCast( const SpellType* spell, Unit* unit, Unit* target,
for( i=0; i<NumUnits; ++i ) {
// FIXME: this tries to draw all corps, ohje
#ifdef NEW_ORDERS
if( (Units[i]->Type->Vanishes
|| Units[i]->Orders[0].Action==UnitActionDie)
&& Units[i]->X == x && Units[i]->Y == y ) {
#else
if( (Units[i]->Type->Vanishes
|| Units[i]->Command.Action==UnitActionDie)
&& Units[i]->X == x && Units[i]->Y == y ) {
#endif
|| Units[i]->Orders[0].Action==UnitActionDie)
&& Units[i]->X == x && Units[i]->Y == y ) {
//FIXME: URGENT: remove corpse
//RemoveUnit( Units[i] );
//UnitLost( Units[i] );