Repaired holy vision.
This commit is contained in:
parent
31721024d6
commit
b75517d9a7
6 changed files with 19 additions and 19 deletions
src
|
@ -40,13 +40,6 @@
|
|||
*/
|
||||
global void HandleActionDie(Unit* unit)
|
||||
{
|
||||
if ( unit->Revealer ) { // Dummy unit. FIXME: own action?
|
||||
if( !--unit->HP ) {
|
||||
ReleaseUnit(unit);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Show death animation
|
||||
//
|
||||
|
|
|
@ -219,6 +219,9 @@
|
|||
**
|
||||
** Unit::Revealer
|
||||
**
|
||||
** `revealer' is unit that has to keep the fog of war revealed
|
||||
** for some time, this unit cannot be used in usual manner.
|
||||
** JOHNS: Should be moved into unit-type!
|
||||
**
|
||||
** Unit::OnBoard
|
||||
**
|
||||
|
@ -457,10 +460,7 @@ struct _unit_ {
|
|||
** ,used for fancy buildings
|
||||
*/
|
||||
unsigned Rs : 8;
|
||||
unsigned Revealer; // hack -- `revealer' is unit that
|
||||
// has to keep FOW revealed for some
|
||||
// time, this unit cannot be used in
|
||||
// usual manner
|
||||
unsigned Revealer : 1; /// reveal the fog of war
|
||||
|
||||
#define MAX_UNITS_ONBOARD 6 /// max number of units in transporter
|
||||
// FIXME: use the new next pointer
|
||||
|
@ -736,7 +736,7 @@ extern void UpgradeButtons(int upgrade);
|
|||
// in unit_draw.c
|
||||
/// FIXME: more docu
|
||||
extern void LoadDecorations(void);
|
||||
/// FIXME: more docu
|
||||
/// Draw all units visible on map
|
||||
extern void DrawUnits(void);
|
||||
|
||||
// in unit_find.c
|
||||
|
|
|
@ -345,6 +345,8 @@ global void MapUpdateFogOfWar(int x,int y)
|
|||
|
||||
/**
|
||||
** Update visible of the map.
|
||||
**
|
||||
** @todo This function could be improved in speed and functionality.
|
||||
*/
|
||||
global void MapUpdateVisible(void)
|
||||
{
|
||||
|
@ -399,6 +401,11 @@ global void MapUpdateVisible(void)
|
|||
for( i=0; i<nunits; i++ ) {
|
||||
unit=units[i];
|
||||
if( unit->Removed ) {
|
||||
if( unit->Revealer ) {
|
||||
MapMarkSight(unit->X+unit->Type->TileWidth/2
|
||||
,unit->Y+unit->Type->TileHeight/2,10);
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// If peon is in the mine, the mine has a sight range too.
|
||||
// This is quite dirty code...
|
||||
|
@ -430,8 +437,7 @@ global void MapUpdateVisible(void)
|
|||
#else
|
||||
MapMarkSight(unit->X+unit->Type->TileWidth/2
|
||||
,unit->Y+unit->Type->TileHeight/2
|
||||
,unit->Stats->SightRange*(unit->Revealer == 0)
|
||||
+ 12*(unit->Revealer != 0));
|
||||
,unit->Stats->SightRange);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -532,10 +532,12 @@ global int SpellCast(const SpellType * spell, Unit * unit, Unit * target,
|
|||
unit->Mana -= spell->ManaCost; // get mana cost
|
||||
target = MakeUnit(UnitTypeByIdent("unit-daemon"), unit->Player);
|
||||
target->Revealer = 1;
|
||||
target->Orders[0].Action = UnitActionDie;
|
||||
target->HP = 2; // Counter lifing?
|
||||
target->Orders[0].Action = UnitActionStill;
|
||||
target->HP = 0;
|
||||
target->X = x;
|
||||
target->Y = y;
|
||||
target->TTL=FrameCounter+FRAMES_PER_SECOND+FRAMES_PER_SECOND/2;
|
||||
//temp->TTL=FrameCounter+target->Type->DecayRate*6*FRAMES_PER_SECOND;
|
||||
break;
|
||||
|
||||
case SpellActionHealing:
|
||||
|
|
|
@ -200,8 +200,7 @@ global Unit* MakeUnit(UnitType* type,Player* player)
|
|||
//
|
||||
// Can use released unit?
|
||||
//
|
||||
// FIXME: releasing disabled until references are working correct.
|
||||
if( 1 && ReleasedHead && ReleasedHead->Refs<FrameCounter ) {
|
||||
if( ReleasedHead && ReleasedHead->Refs<FrameCounter ) {
|
||||
unit=ReleasedHead;
|
||||
ReleasedHead=unit->Next;
|
||||
if( ReleasedTail==&unit->Next ) { // last element
|
||||
|
|
|
@ -1022,7 +1022,7 @@ local void DrawUnit(const Unit* unit)
|
|||
const UnitStats* stats;
|
||||
|
||||
if ( unit->Revealer ) { // Revealers are not drawn
|
||||
DebugLevel0Fn("Drawing revealer\n");
|
||||
DebugLevel3Fn("Drawing revealer %Zd\n",UnitNumber(unit));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue