Skip to content

Commit

Permalink
- make Blood's burn source a pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Dec 5, 2021
1 parent 7fd6038 commit ea677d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions source/games/blood/src/bloodactor.h
Expand Up @@ -94,13 +94,12 @@ class DBloodActor : public DCoreActor

void SetBurnSource(DBloodActor* own)
{
x().burnSource = own ? own->GetSpriteIndex() : -1;
x().burnSource = own;
}

DBloodActor* GetBurnSource()
{
if (x().burnSource == -1 || x().burnSource == kMaxSprites - 1) return nullptr;
return base() + x().burnSource;
return x().burnSource;
}

void SetSpecialOwner() // nnext hackery
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/db.cpp
Expand Up @@ -857,7 +857,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, sect
pXSprite->targetY = bitReader.readSigned(32);
pXSprite->targetZ = bitReader.readSigned(32);
pXSprite->burnTime = bitReader.readUnsigned(16);
pXSprite->burnSource = bitReader.readSigned(16);
/*pXSprite->burnSource =*/ bitReader.readSigned(16);
pXSprite->height = bitReader.readUnsigned(16);
pXSprite->stateTimer = bitReader.readUnsigned(16);
pXSprite->aiState = NULL;
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/mapstructs.h
Expand Up @@ -47,6 +47,7 @@ struct XSPRITE {
};

DBloodActor* target; // target sprite
DBloodActor* burnSource;

int32_t targetX; // target x
int32_t targetY; // target y
Expand All @@ -61,7 +62,6 @@ struct XSPRITE {
int16_t data1; // Data 1
int16_t data2; // Data 2
int16_t data3; // Data 3
int16_t burnSource;
uint16_t txID; // TX ID
uint16_t rxID; // RX ID
uint16_t command; // Cmd
Expand Down

0 comments on commit ea677d4

Please sign in to comment.