diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index ed677d36d..620236fd4 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -348,10 +348,10 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, sectortype** cur pXSector->stopOn = bitReader.readUnsigned(1); pXSector->stopOff = bitReader.readUnsigned(1); pXSector->ceilpal = bitReader.readUnsigned(4); - pXSector->_offCeilZ = bitReader.readSigned(32); - pXSector->_onCeilZ = bitReader.readSigned(32); - pXSector->_offFloorZ = bitReader.readSigned(32); - pXSector->_onFloorZ = bitReader.readSigned(32); + pXSector->offCeilZ = bitReader.readSigned(32) * zmaptoworld; + pXSector->onCeilZ = bitReader.readSigned(32) * zmaptoworld; + pXSector->offFloorZ = bitReader.readSigned(32) * zmaptoworld; + pXSector->onFloorZ = bitReader.readSigned(32) * zmaptoworld; /*pXSector->marker0 =*/ bitReader.readUnsigned(16); /*pXSector->marker1 =*/ bitReader.readUnsigned(16); pXSector->Crush = bitReader.readUnsigned(1); diff --git a/source/games/blood/src/loadsave.cpp b/source/games/blood/src/loadsave.cpp index c2c746ff0..814166a40 100644 --- a/source/games/blood/src/loadsave.cpp +++ b/source/games/blood/src/loadsave.cpp @@ -559,10 +559,10 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSECTOR& w, XSECTO ("data", w.data, def->data) ("txid", w.txID, def->txID) ("rxid", w.rxID, def->rxID) - ("offceilz", w._offCeilZ, def->_offCeilZ) - ("onceilz", w._onCeilZ, def->_onCeilZ) - ("offloorz", w._offFloorZ, def->_offFloorZ) - ("onloorz", w._onFloorZ, def->_onFloorZ) + ("offceilz", w.offCeilZ, def->offCeilZ) + ("onceilz", w.onCeilZ, def->onCeilZ) + ("offloorz", w.offFloorZ, def->offFloorZ) + ("onloorz", w.onFloorZ, def->onFloorZ) ("windvel", w.windVel, def->windVel) ("busytimea", w.busyTimeA, def->busyTimeA) ("busytimeb", w.busyTimeB, def->busyTimeB) diff --git a/source/games/blood/src/mapstructs.h b/source/games/blood/src/mapstructs.h index dc19901a2..495aea7f8 100644 --- a/source/games/blood/src/mapstructs.h +++ b/source/games/blood/src/mapstructs.h @@ -190,15 +190,15 @@ struct XSECTOR { DBloodActor* actordata; uint32_t busy; - int32_t _offCeilZ; - int32_t _onCeilZ; - int32_t _offFloorZ; - int32_t _onFloorZ; + double offCeilZ; + double onCeilZ; + double offFloorZ; + double onFloorZ; - int int_offCeilZ() const { return _offCeilZ; } - int int_onCeilZ() const { return _onCeilZ; } - int int_offFloorZ() const { return _offFloorZ; } - int int_onFloorZ() const { return _onFloorZ; } + int int_offCeilZ() const { return offCeilZ * zworldtoint; } + int int_onCeilZ() const { return onCeilZ * zworldtoint; } + int int_offFloorZ() const { return offFloorZ * zworldtoint; } + int int_onFloorZ() const { return onFloorZ * zworldtoint; } uint32_t windVel; // Wind vel (changed from 10 bit to use higher velocity values) diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 59b7f6a5f..b8534dd2f 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1678,8 +1678,8 @@ void OperatePath(sectortype* pSector, EVENT event) } pXSector->marker1 = actor; - pXSector->_offFloorZ = marker0->int_pos().Z; - pXSector->_onFloorZ = actor->int_pos().Z; + pXSector->offFloorZ = marker0->spr.pos.Z; + pXSector->onFloorZ = actor->spr.pos.Z; switch (event.cmd) { case kCmdOn: pXSector->state = 0;