SAGA2: Replace custom assert macros

This commit is contained in:
Eugene Sandulenko 2021-05-27 20:05:08 +02:00
parent 36ead351f1
commit 177aa92900
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
65 changed files with 671 additions and 817 deletions

View File

@ -3230,7 +3230,7 @@ bool Actor::takeMana(ActorManaID i, int8 dMana) {
if (!isPlayerActor(this))
return TRUE;
#endif
VERIFY(i >= manaIDRed && i <= manaIDViolet);
assert(i >= manaIDRed && i <= manaIDViolet);
if ((&effectiveStats.redMana)[i] < dMana)
return FALSE;
(&effectiveStats.redMana)[i] -= dMana;
@ -3243,7 +3243,7 @@ bool Actor::hasMana(ActorManaID i, int8 dMana) {
if (!isPlayerActor(this))
return TRUE;
#endif
VERIFY(i >= manaIDRed && i <= manaIDViolet);
assert(i >= manaIDRed && i <= manaIDViolet);
if ((&effectiveStats.redMana)[i] < dMana)
return FALSE;
return TRUE;

View File

@ -718,7 +718,7 @@ public:
// Allocate the assignment buffer for a new assignment
void *allocAssignment(size_t sz) {
ASSERT(sz <= sizeof(assignmentBuf));
assert(sz <= sizeof(assignmentBuf));
if (!(flags & hasAssignment)) {
flags |= hasAssignment;
return &assignmentBuf;
@ -915,7 +915,7 @@ public:
void disband(void);
bool inBandingRange(void) {
ASSERT(leader != NULL);
assert(leader != NULL);
return leader->IDParent() == IDParent()
&& (leader->getLocation() - getLocation()).quickHDistance()

View File

@ -331,7 +331,7 @@ Task *PatrolRouteAssignment::getTask(TaskStack *ts) {
void HuntToBeNearLocationAssignment::initialize(
const Target &targ,
uint16 r) {
ASSERT(targ.size() <= sizeof(targetMem));
assert(targ.size() <= sizeof(targetMem));
// Make a copy of the target
targ.clone(targetMem);
@ -418,7 +418,7 @@ void HuntToBeNearActorAssignment::initialize(
const ActorTarget &at,
uint16 r,
bool trackFlag) {
ASSERT(at.size() <= sizeof(targetMem));
assert(at.size() <= sizeof(targetMem));
// Copy the target
at.clone(targetMem);
@ -524,7 +524,7 @@ void HuntToKillAssignment::initialize(
const ActorTarget &at,
bool trackFlag,
bool specificActorFlag) {
ASSERT(at.size() <= sizeof(targetMem));
assert(at.size() <= sizeof(targetMem));
// Copy the target
at.clone(targetMem);

View File

@ -61,7 +61,7 @@ extern audioInterface *audio;
/*******************************************************************/
Buffer::Buffer(size_t newSize) {
VERIFY(newSize > 0);
assert(newSize > 0);
internallyAllocated = TRUE;
size = newSize;
@ -77,7 +77,7 @@ Buffer::Buffer(size_t newSize) {
Buffer::~Buffer(void) {
if (internallyAllocated) {
VERIFY(data[0]);
assert(data[0]);
audio_unlock(data[0], size);
audioFree(data[0]); //delete [] data[0];
data[0] = NULL;
@ -113,8 +113,8 @@ cacheBuffer::~cacheBuffer(void) {
doubleBuffer::doubleBuffer(size_t newSize, audioInterface *sd, int16 newID)
: Buffer(newSize) {
if (sd && sd->enabled(volVoice)) {
VERIFY(sd);
//VERIFY( sd->dig );
assert(sd);
//assert( sd->dig );
bufID = newID;
fillBuffer = 0;
@ -134,7 +134,7 @@ doubleBuffer::doubleBuffer(size_t newSize, audioInterface *sd, int16 newID)
}
doubleBuffer::~doubleBuffer(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (data[1]) {
audio_unlock(data[1], size);
audioFree(data[1]); //delete [] data[1];
@ -152,8 +152,8 @@ doubleBuffer::~doubleBuffer(void) {
singleBuffer::singleBuffer(size_t newSize, audioInterface *sd, int16 newID)
: Buffer(newSize) {
if (sd && sd->enabled(volSound)) {
VERIFY(sd);
VERIFY(sd->dig);
assert(sd);
assert(sd->dig);
bufID = newID;
fillBuffer = 0;
@ -170,7 +170,7 @@ singleBuffer::singleBuffer(size_t newSize, audioInterface *sd, int16 newID)
}
singleBuffer::~singleBuffer(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (ailSampleHandle) {
AIL_release_sample_handle(ailSampleHandle);
}
@ -183,8 +183,8 @@ singleBuffer::~singleBuffer(void) {
musicBuffer::musicBuffer(size_t newSize, audioInterface *sd, int16 newID)
: Buffer(newSize) {
if (sd && sd->enabled(volMusic)) {
VERIFY(sd);
VERIFY(sd->mid);
assert(sd);
assert(sd->mid);
bufID = newID;
fillBuffer = 0;
@ -198,7 +198,7 @@ musicBuffer::musicBuffer(size_t newSize, audioInterface *sd, int16 newID)
}
musicBuffer::~musicBuffer(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (ailSampleHandle) {
AIL_release_sequence_handle(ailSampleHandle);
}
@ -213,14 +213,14 @@ musicBuffer::~musicBuffer(void) {
void workBuffer::shiftdown(int16 bufNo) {
long dif = size - (wSize + rSize);
VERIFY(bufNo == 0);
VERIFY(dif >= 0);
VERIFY(dif <= (size - (rSize + wSize)));
VERIFY(((char *)(data[bufNo]) + rSize) < ((char *) rData));
VERIFY(dif > rSize);
VERIFY(dif > wSize);
VERIFY(data[bufNo]);
VERIFY(rData);
assert(bufNo == 0);
assert(dif >= 0);
assert(dif <= (size - (rSize + wSize)));
assert(((char *)(data[bufNo]) + rSize) < ((char *) rData));
assert(dif > rSize);
assert(dif > wSize);
assert(data[bufNo]);
assert(rData);
if (dif > 0 && rSize > 0) {
char *tbuf = (char *) audioAlloc(rSize, "audio work buffer"); //new char[rSize];
@ -258,7 +258,7 @@ void cacheBuffer::format(soundSample *) {
void doubleBuffer::format(soundSample *ss) {
if (audioSet == 0) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
AIL_init_sample(ailSampleHandle);
AIL_set_sample_type(ailSampleHandle, ss->format(), ss->flags());
AIL_set_sample_playback_rate(ailSampleHandle, ss->speed);
@ -270,7 +270,7 @@ void doubleBuffer::format(soundSample *ss) {
}
void singleBuffer::format(soundSample *ss) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
AIL_init_sample(ailSampleHandle);
AIL_set_sample_type(ailSampleHandle, ss->format(), ss->flags());
AIL_set_sample_playback_rate(ailSampleHandle, ss->speed);
@ -304,7 +304,7 @@ bool workBuffer::laden(void) {
// sound buffers need to find out from AIL whether a buffer is free
bool doubleBuffer::laden(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (-1 == washed())
return TRUE;
else if (targetSated)
@ -313,7 +313,7 @@ bool doubleBuffer::laden(void) {
}
bool singleBuffer::laden(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (targetSated)
activate(0);
return (FALSE);
@ -347,7 +347,7 @@ uint32 workBuffer::sample_status(void) {
uint32 doubleBuffer::sample_status(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
#if 0
int32 newPos = AIL_sample_position(ailSampleHandle);
if (targetPos == 0 || newPos >= targetPos) { //( newPos==lastPos && lastPos==distPos)
@ -360,7 +360,7 @@ uint32 doubleBuffer::sample_status(void) {
}
uint32 singleBuffer::sample_status(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
return (AIL_sample_status(ailSampleHandle));
}
@ -402,7 +402,7 @@ int16 workBuffer::washed(void) {
}
int16 doubleBuffer::washed(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (AILLOCated > -1) return AILLOCated;
AILLOCated = AIL_sample_buffer_ready(ailSampleHandle);
return AILLOCated;
@ -428,7 +428,7 @@ int16 cacheBuffer::washed(void) {
/* */
void Buffer::gave(size_t dSize) {
VERIFY(dSize <= wSize);
assert(dSize <= wSize);
wSize -= dSize;
rSize += dSize;
if (wSize)
@ -437,7 +437,7 @@ void Buffer::gave(size_t dSize) {
}
void workBuffer::gave(size_t dSize) {
VERIFY(dSize <= wSize);
assert(dSize <= wSize);
wSize -= dSize;
rSize += dSize;
if (wSize) {
@ -449,22 +449,22 @@ void workBuffer::gave(size_t dSize) {
// when sound buffers get full they automatically trigger AIL
void doubleBuffer::gave(size_t dSize) {
VERIFY(ailSampleHandle);
VERIFY(dSize <= wSize);
assert(ailSampleHandle);
assert(dSize <= wSize);
wSize -= dSize;
rSize += dSize;
if (wSize) {
wData = (void *)(((char *) data[fillBuffer]) + (size - wSize));
} else {
VERIFY(AILLOCated >= 0);
assert(AILLOCated >= 0);
play(AILLOCated);
activate(1 - fillBuffer);
}
}
void singleBuffer::gave(size_t dSize) {
VERIFY(ailSampleHandle);
VERIFY(dSize <= wSize);
assert(ailSampleHandle);
assert(dSize <= wSize);
lastRSize = rSize;
wSize -= dSize;
rSize += dSize;
@ -476,8 +476,8 @@ void singleBuffer::gave(size_t dSize) {
}
void musicBuffer::gave(size_t dSize) {
VERIFY(ailSampleHandle);
VERIFY(dSize <= wSize);
assert(ailSampleHandle);
assert(dSize <= wSize);
wSize -= dSize;
rSize += dSize;
if (wSize) {
@ -489,7 +489,7 @@ void musicBuffer::gave(size_t dSize) {
}
void cacheBuffer::gave(size_t dSize) {
VERIFY(dSize <= wSize);
assert(dSize <= wSize);
wSize -= dSize;
rSize += dSize;
if (wSize) {
@ -501,7 +501,7 @@ void cacheBuffer::gave(size_t dSize) {
// when work buffers get fully drained they reset themselves
void Buffer::took(size_t dSize) {
VERIFY(dSize <= rSize);
assert(dSize <= rSize);
rSize -= dSize;
if (rSize > 0)
rData = (void *)(((char *) rData) + dSize);
@ -510,7 +510,7 @@ void Buffer::took(size_t dSize) {
}
void workBuffer::took(size_t dSize) {
VERIFY(dSize <= rSize);
assert(dSize <= rSize);
rSize -= dSize;
if (rSize > 0) {
rData = (void *)(((char *) rData) + dSize);
@ -521,14 +521,14 @@ void workBuffer::took(size_t dSize) {
}
void doubleBuffer::took(size_t dSize) {
VERIFY(dSize <= rSize);
assert(dSize <= rSize);
rSize -= dSize;
if (rSize > 0)
rData = (void *)(((char *) rData) + dSize);
}
void singleBuffer::took(size_t dSize) {
VERIFY(dSize <= rSize);
assert(dSize <= rSize);
lastRSize = rSize;
rSize -= dSize;
if (rSize > 0)
@ -536,14 +536,14 @@ void singleBuffer::took(size_t dSize) {
}
void musicBuffer::took(size_t dSize) {
VERIFY(dSize <= rSize);
assert(dSize <= rSize);
rSize -= dSize;
if (rSize > 0)
rData = (void *)(((char *) rData) + dSize);
}
void cacheBuffer::took(size_t dSize) {
VERIFY(dSize <= rSize);
assert(dSize <= rSize);
}
/*******************************************************************/
@ -570,8 +570,8 @@ void workBuffer::fill(void) {
// sound buffers pass what they have to AIL
void doubleBuffer::fill(void) {
VERIFY(ailSampleHandle);
VERIFY(AILLOCated >= 0);
assert(ailSampleHandle);
assert(AILLOCated >= 0);
if (rSize) {
play(AILLOCated);
activate(1 - fillBuffer);
@ -581,14 +581,14 @@ void doubleBuffer::fill(void) {
}
void singleBuffer::fill(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
if (rSize) {
play(0);
}
}
void musicBuffer::fill(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
play(0);
}
@ -625,8 +625,8 @@ void doubleBuffer::abortsound(void) {
}
void doubleBuffer::release(void) {
VERIFY(ailSampleHandle);
VERIFY(rSize == 0);
assert(ailSampleHandle);
assert(rSize == 0);
if (washed() <= -1) {
if (sample_status() != SMP_STOPPED)
@ -639,7 +639,7 @@ void doubleBuffer::release(void) {
AIL_end_sample(ailSampleHandle);
audioSet = 0;
audio->resetState((audioInterface::BufferRequest) ID());
VERIFY(AILLOCated == -1);
assert(AILLOCated == -1);
}
void singleBuffer::abortsound(void) {
@ -650,11 +650,11 @@ void singleBuffer::abortsound(void) {
}
void singleBuffer::release(void) {
VERIFY(ailSampleHandle);
VERIFY(rSize == 0);
assert(ailSampleHandle);
assert(rSize == 0);
// AIL_end_sample( ailSampleHandle );
audioSet = 0;
VERIFY(AILLOCated == -1);
assert(AILLOCated == -1);
}
void musicBuffer::abortsound(void) {
@ -664,7 +664,7 @@ void musicBuffer::abortsound(void) {
}
void musicBuffer::release(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
// new
AIL_end_sequence(ailSampleHandle);
audioSet = 0;
@ -686,13 +686,13 @@ void Buffer::play(int16) {
}
void workBuffer::play(int16 bufNo) {
VERIFY(bufNo == 0);
assert(bufNo == 0);
took(rSize);
}
void doubleBuffer::play(int16 bufNo) {
VERIFY(bufNo >= 0 && bufNo <= 1);
VERIFY(ailSampleHandle);
assert(bufNo >= 0 && bufNo <= 1);
assert(ailSampleHandle);
targetPos = (int32)((char *) rData - (char *)data[AILLOCated]) + rSize;
AIL_load_sample_buffer(ailSampleHandle, AILLOCated, rData, rSize);
took(rSize);
@ -700,8 +700,8 @@ void doubleBuffer::play(int16 bufNo) {
}
void singleBuffer::play(int16 bufNo) {
VERIFY(bufNo == 0);
VERIFY(ailSampleHandle);
assert(bufNo == 0);
assert(ailSampleHandle);
AIL_set_sample_address(ailSampleHandle, rData, rSize);
AIL_set_sample_loop_count(ailSampleHandle, loopCount);
AIL_start_sample(ailSampleHandle);
@ -709,18 +709,18 @@ void singleBuffer::play(int16 bufNo) {
}
void singleBuffer::replay(void) {
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
rSize = lastRSize; //((uint8 *)rData)-((uint8 *)data[0]) ;
rData = data[0];
VERIFY(rSize);
assert(rSize);
AIL_set_sample_address(ailSampleHandle, rData, rSize);
AIL_set_sample_loop_count(ailSampleHandle, loopCount);
AIL_start_sample(ailSampleHandle);
}
void musicBuffer::play(int16 bufNo) {
VERIFY(bufNo == 0);
VERIFY(ailSampleHandle);
assert(bufNo == 0);
assert(ailSampleHandle);
if (AIL_init_sequence(ailSampleHandle, rData, 0) <= 0) {
error("musicBuffer::play");
}
@ -748,8 +748,8 @@ void Buffer::activate(int16) {
}
void workBuffer::activate(int16 bufNo) {
VERIFY(bufNo == 0);
VERIFY(rSize == 0);
assert(bufNo == 0);
assert(rSize == 0);
if (washed() > -1) {
fillBuffer = 0;
wSize = size;
@ -761,7 +761,7 @@ void workBuffer::activate(int16 bufNo) {
void doubleBuffer::activate(int16 bufNo) {
int32 n;
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
n = bufNo;
if (washed() > -1) {
targetSated = FALSE;
@ -782,7 +782,7 @@ void doubleBuffer::activate(int16 bufNo) {
void singleBuffer::activate(int16 bufNo) {
int32 n;
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
n = bufNo;
targetSated = FALSE;
fillBuffer = 0;
@ -794,7 +794,7 @@ void singleBuffer::activate(int16 bufNo) {
void musicBuffer::activate(int16 bufNo) {
int32 n;
VERIFY(ailSampleHandle);
assert(ailSampleHandle);
n = bufNo;
audioSet = 0;
if (washed() > -1) {
@ -815,7 +815,7 @@ void musicBuffer::activate(int16 bufNo) {
}
void cacheBuffer::activate(int16 bufNo) {
VERIFY(bufNo == 0);
assert(bufNo == 0);
}
/*******************************************************************/
@ -830,19 +830,19 @@ void Buffer::reset(void) {
void workBuffer::reset(void) {
if (rSize) took(rSize);
VERIFY(rSize == 0);
assert(rSize == 0);
activate(0);
}
void doubleBuffer::reset(void) {
VERIFY(AILLOCated == -1);
assert(AILLOCated == -1);
AIL_init_sample(ailSampleHandle);
audioSet = 0;
targetPos = 0;
}
void singleBuffer::reset(void) {
// VERIFY( AILLOCated==-1 );
// assert( AILLOCated==-1 );
AIL_init_sample(ailSampleHandle);
audioSet = 0;
}
@ -854,7 +854,7 @@ void musicBuffer::reset(void) {
}
void cacheBuffer::reset(void) {
VERIFY(rSize == 0);
assert(rSize == 0);
activate(0);
}

View File

@ -121,7 +121,7 @@ int16 hResRead(Buffer &sb, soundSample &ss, hResContext *hrc) {
bread = hrc->readbytes(sb.wData, count);
sb.gave(bread);
VERIFY(bread <= count);
assert(bread <= count);
#if ASYNCH_AUDIO
if (partial)
@ -171,7 +171,7 @@ int16 bufRead(Buffer &sb, soundSample &ss) {
memcpy(sb.wData, clickData[ss.curSeg], count);
sb.gave(bread);
VERIFY(bread <= count);
assert(bread <= count);
if (bread == count)
rVal |= msgBufferFull;

View File

@ -197,10 +197,10 @@ void CAutoMap::locateRegion(void) {
int i;
areaRes = auxResFile->newContext(MKTAG('A', 'M', 'A', 'P'), "AreaList");
VERIFY(areaRes != NULL);
assert(areaRes != NULL);
trRes = (uint16 *)LoadResource(areaRes, MKTAG('Z', 'O', 'N', currentWorld->mapNum), "AreaList");
VERIFY(trRes != NULL);
assert(trRes != NULL);
regionCount = *trRes;
centerCoords = trackPos >> (tileUVShift + platShift);

View File

@ -91,7 +91,7 @@ public:
// Return a pointer to a Band given a BandID
Band *getBandAddress(BandID id) {
ASSERT(id >= 0 && id < numBands);
assert(id >= 0 && id < numBands);
return array[ id ].getBand();
}
};
@ -220,7 +220,7 @@ void *BandList::newBand(void) {
// Place a specific Band into the active list and return its address
void *BandList::newBand(BandID id) {
ASSERT(id >= 0 && id < elementsof(array));
assert(id >= 0 && id < elementsof(array));
BandPlaceHolder *bp;
@ -388,18 +388,18 @@ Band::Band(void **buf) {
int16 i;
// Restore the leader pointer
ASSERT(isActor(*((ObjectID *)bufferPtr)));
assert(isActor(*((ObjectID *)bufferPtr)));
leader = (Actor *)GameObject::objectAddress(*((ObjectID *)bufferPtr));
bufferPtr = (ObjectID *)bufferPtr + 1;
// Restore the member count
ASSERT(*((int16 *)bufferPtr) < elementsof(members));
assert(*((int16 *)bufferPtr) < elementsof(members));
memberCount = *((int16 *)bufferPtr);
bufferPtr = (int16 *)bufferPtr + 1;
// Restore the member pointers
for (i = 0; i < memberCount; i++) {
ASSERT(isActor(*((ObjectID *)bufferPtr)));
assert(isActor(*((ObjectID *)bufferPtr)));
members[ i ] = (Actor *)GameObject::objectAddress(
*((ObjectID *)bufferPtr));
bufferPtr = (ObjectID *)bufferPtr + 1;

View File

@ -122,7 +122,7 @@ public:
}
void remove(int index) {
ASSERT(index < memberCount);
assert(index < memberCount);
int i;

View File

@ -55,7 +55,7 @@ const uint16 GAME_START_HOUR = 5;
* ===================================================================== */
void CalenderTime::update(void) {
char *text = NULL;
const char *text = NULL;
if (++frameInHour >= framesPerHour) {
frameInHour = 0;
@ -97,7 +97,8 @@ void CalenderTime::update(void) {
break;
}
if (text) StatusMsg(CALENDAR_STATUS, text, dayInWeek + 1, weeks + 1);
if (text)
StatusMsg(CALENDAR_STATUS, text, dayInWeek + 1, weeks + 1);
}
}
@ -239,8 +240,7 @@ void saveCalender(SaveFileConstructor &saveGame) {
// the correct chunk.
void loadCalender(SaveFileReader &saveGame) {
ASSERT(saveGame.getChunkSize()
== sizeof(calenderPaused) + sizeof(calender));
assert(saveGame.getChunkSize() == sizeof(calenderPaused) + sizeof(calender));
saveGame.read(&calenderPaused, sizeof(calenderPaused));
saveGame.read(&calender, sizeof(calender));

View File

@ -808,8 +808,8 @@ void ContainerView::dropPhysical(
GameObject *mObj,
GameObject *cObj,
int16 num) {
ASSERT(mouseInfo.getObject() == mObj);
ASSERT(mObj->containmentSet() & ProtoObj::isTangible);
assert(mouseInfo.getObject() == mObj);
assert(mObj->containmentSet() & ProtoObj::isTangible);
// Place object back where it came from, temporarily
mouseInfo.replaceObject();
@ -839,8 +839,8 @@ void ContainerView::usePhysical(
gPanelMessage &msg,
GameObject *mObj,
GameObject *cObj) {
ASSERT(mouseInfo.getObject() == mObj);
ASSERT(mObj->containmentSet() & ProtoObj::isTangible);
assert(mouseInfo.getObject() == mObj);
assert(mObj->containmentSet() & ProtoObj::isTangible);
if (cObj == NULL) {
dropPhysical(msg, mObj, cObj);
@ -856,8 +856,8 @@ void ContainerView::useConcept(
gPanelMessage &msg,
GameObject *mObj,
GameObject *cObj) {
ASSERT(mouseInfo.getObject() == mObj);
ASSERT(mObj->containmentSet() & ProtoObj::isIntangible);
assert(mouseInfo.getObject() == mObj);
assert(mObj->containmentSet() & ProtoObj::isIntangible);
mouseInfo.replaceObject();
@ -939,7 +939,7 @@ void ContainerView::updateMouseText(Point16 &pickPos) {
// Functions do not appear to be called
void ContainerView::setCursorText(GameObject *obj) {
ASSERT(obj);
assert(obj);
const bufSize = 40;
char cursorText[ bufSize ];
@ -1219,8 +1219,8 @@ ScrollableContainerWindow::ScrollableContainerWindow(
0,
cmdScrollFunc); // mind app func
ASSERT(view != NULL);
ASSERT(scrollCompButton != NULL);
assert(view != NULL);
assert(scrollCompButton != NULL);
}
/* ===================================================================== *
@ -1231,8 +1231,8 @@ TangibleContainerWindow::TangibleContainerWindow(
ContainerNode &nd, ContainerAppearanceDef &app)
: ScrollableContainerWindow(nd, app, "ObjectWindow") {
#if DEBUG
ASSERT(view->containerObject);
ASSERT(view->containerObject->proto());
assert(view->containerObject);
assert(view->containerObject->proto());
#endif
const int weightIndicatorType = 2;
@ -1255,7 +1255,7 @@ TangibleContainerWindow::TangibleContainerWindow(
};
uint16 bgndType = view->containerObject->proto()->appearanceType;
ASSERT(bgndType < 4);
assert(bgndType < 4);
setContainerSprite(); // show at the top of the box
@ -1342,7 +1342,7 @@ IntangibleContainerWindow::IntangibleContainerWindow(
0,
cmdMindContainerFunc); // mind app func
ASSERT(mindSelectorCompButton != NULL);
assert(mindSelectorCompButton != NULL);
mindSelectorCompButton->setResponse(FALSE);
@ -1373,8 +1373,8 @@ EnchantmentContainerWindow::EnchantmentContainerWindow(
0,
cmdScrollFunc); // mind app func
ASSERT(view != NULL);
ASSERT(scrollCompButton != NULL);
assert(view != NULL);
assert(scrollCompButton != NULL);
}
/* ===================================================================== *
@ -1499,7 +1499,7 @@ void ContainerNode::hide(void) {
void ContainerNode::show(void) {
ProtoObj *proto = GameObject::protoAddress(object);
ASSERT(proto);
assert(proto);
// open the window; Object should already be "open"
if (window == NULL) {
@ -1796,7 +1796,7 @@ void initContainerNodes(void) {
}
}
ASSERT(onlyReady);
assert(onlyReady);
#endif
}
@ -1896,7 +1896,7 @@ void loadContainerNodes(SaveFileReader &saveGame) {
globalContainerList.add(*node);
}
ASSERT(tempList.empty());
assert(tempList.empty());
// Free the archive buffer
RDisposePtr(archiveBuffer);
@ -1934,8 +1934,8 @@ void setMindContainer(int index, IntangibleContainerWindow &cw) {
GameObject *newContainer = NULL;
ObjectID id;
ASSERT(index >= 0);
ASSERT(index < elementsof(classTable));
assert(index >= 0);
assert(index < elementsof(classTable));
int containerClass = classTable[ index ];

View File

@ -581,22 +581,22 @@ void DisplayNode::drawObject(void) {
a->currentFacing,
a->currentPose);
ASSERT(anim->start[ 0 ] >= 0);
ASSERT(anim->start[ 0 ] < 10000);
ASSERT(anim->start[ 1 ] >= 0);
ASSERT(anim->start[ 1 ] < 10000);
ASSERT(anim->start[ 2 ] >= 0);
ASSERT(anim->start[ 2 ] < 10000);
assert(anim->start[ 0 ] >= 0);
assert(anim->start[ 0 ] < 10000);
assert(anim->start[ 1 ] >= 0);
assert(anim->start[ 1 ] < 10000);
assert(anim->start[ 2 ] >= 0);
assert(anim->start[ 2 ] < 10000);
ASSERT(pose->rightObjectOffset.x < 1000);
ASSERT(pose->rightObjectOffset.x > -1000);
ASSERT(pose->rightObjectOffset.y < 1000);
ASSERT(pose->rightObjectOffset.y > -1000);
assert(pose->rightObjectOffset.x < 1000);
assert(pose->rightObjectOffset.x > -1000);
assert(pose->rightObjectOffset.y < 1000);
assert(pose->rightObjectOffset.y > -1000);
ASSERT(pose->leftObjectOffset.x < 1000);
ASSERT(pose->leftObjectOffset.x > -1000);
ASSERT(pose->leftObjectOffset.y < 1000);
ASSERT(pose->leftObjectOffset.y > -1000);
assert(pose->leftObjectOffset.x < 1000);
assert(pose->leftObjectOffset.x > -1000);
assert(pose->leftObjectOffset.y < 1000);
assert(pose->leftObjectOffset.y > -1000);
// washHandle( aa->spriteBanks[ pose->actorFrameBank ] );
@ -699,7 +699,7 @@ void DisplayNode::drawObject(void) {
// Fill in the SpriteComponent structure for body
sc = &scList[ bodyIndex ];
ASSERT(a->poseInfo.actorFrameIndex < ss->count);
assert(a->poseInfo.actorFrameIndex < ss->count);
sc->sp = ss->sprite(a->poseInfo.actorFrameIndex);
sc->offset.x = sc->offset.y = 0;
// Color remapping info
@ -707,11 +707,11 @@ void DisplayNode::drawObject(void) {
// sc->colorTable = aa->schemeList ? mainColors : identityColors;
sc->flipped = (poseFlags & ActorPose::actorFlipped);
ASSERT(sc->sp != NULL);
ASSERT(sc->sp->size.x > 0);
ASSERT(sc->sp->size.y > 0);
ASSERT(sc->sp->size.x < 255);
ASSERT(sc->sp->size.y < 255);
assert(sc->sp != NULL);
assert(sc->sp->size.x > 0);
assert(sc->sp->size.y > 0);
assert(sc->sp->size.x < 255);
assert(sc->sp->size.y < 255);
// If we were carrying something in the left hand,
// then fill in the component structure for it.
@ -728,12 +728,12 @@ void DisplayNode::drawObject(void) {
sc->sp = proto->getOrientedSprite(
obj,
a->poseInfo.leftObjectIndex);
ASSERT(sc->sp != NULL);
assert(sc->sp != NULL);
sc->offset = a->poseInfo.leftObjectOffset;
ASSERT(sc->offset.x < 1000);
ASSERT(sc->offset.x > -1000);
ASSERT(sc->offset.y < 1000);
ASSERT(sc->offset.y > -1000);
assert(sc->offset.x < 1000);
assert(sc->offset.x > -1000);
assert(sc->offset.y < 1000);
assert(sc->offset.y > -1000);
sc->colorTable = leftColors;
sc->flipped = (poseFlags & ActorPose::leftObjectFlipped);
}
@ -753,16 +753,16 @@ void DisplayNode::drawObject(void) {
sc->sp = proto->getOrientedSprite(
obj,
a->poseInfo.rightObjectIndex);
ASSERT(sc->sp != NULL);
ASSERT(sc->sp->size.x > 0);
ASSERT(sc->sp->size.y > 0);
ASSERT(sc->sp->size.x < 255);
ASSERT(sc->sp->size.y < 255);
assert(sc->sp != NULL);
assert(sc->sp->size.x > 0);
assert(sc->sp->size.y > 0);
assert(sc->sp->size.x < 255);
assert(sc->sp->size.y < 255);
sc->offset = a->poseInfo.rightObjectOffset;
ASSERT(sc->offset.x < 1000);
ASSERT(sc->offset.x > -1000);
ASSERT(sc->offset.y < 1000);
ASSERT(sc->offset.y > -1000);
assert(sc->offset.x < 1000);
assert(sc->offset.x > -1000);
assert(sc->offset.y < 1000);
assert(sc->offset.y > -1000);
sc->colorTable = rightColors;
sc->flipped = (poseFlags & ActorPose::rightObjectFlipped);
}

View File

@ -93,7 +93,7 @@ void ProtoDamage::implement(GameObject *cst, SpellTarget *trg, int8 deltaDamage)
ObjectID pID = cst->possessor();
if (pID != Nothing) {
Actor *p = (Actor *) GameObject::objectAddress(pID);
VERIFY(isActor(p));
assert(isActor(p));
if (totalDice > 0 && trg->getObject() && isActor(trg->getObject()))
offensiveNotification(p, (Actor *) trg->getObject());
}
@ -101,7 +101,7 @@ void ProtoDamage::implement(GameObject *cst, SpellTarget *trg, int8 deltaDamage)
totalBase -= deltaDamage;
VERIFY(trg->getType() == SpellTarget::spellTargetObject);
assert(trg->getType() == SpellTarget::spellTargetObject);
if (self)
cst->acceptDamage(cst->thisID(), totalBase, type, totalDice, sides);
else
@ -174,7 +174,7 @@ void ProtoDrainage::implement(GameObject *cst, SpellTarget *trg, int8) {
ObjectID pID = cst->possessor();
if (pID != Nothing) {
Actor *p = (Actor *) GameObject::objectAddress(pID);
VERIFY(isActor(p));
assert(isActor(p));
if (totalDice > 0 && trg->getObject() && isActor(trg->getObject()))
offensiveNotification(p, (Actor *) trg->getObject());
}
@ -222,7 +222,7 @@ void ProtoEnchantment::implement(GameObject *cst, SpellTarget *trg, int8) {
ObjectID pID = cst->possessor();
if (pID != Nothing) {
Actor *p = (Actor *) GameObject::objectAddress(pID);
VERIFY(isActor(p));
assert(isActor(p));
offensiveNotification(p, (Actor *) trg->getObject());
}
}
@ -246,7 +246,7 @@ void ProtoEnchantment::implement(GameObject *cst, SpellTarget *trg, int8) {
void ProtoTAGEffect::implement(GameObject *cst, SpellTarget *trg, int8) {
ActiveItem *tag = trg->getTAG();
VERIFY(tag);
assert(tag);
if (affectBit == settagLocked) {
//if ( tag->builtInBehavior()==ActiveItem::builtInDoor )
if (tag->isLocked() != onOff)
@ -261,7 +261,7 @@ void ProtoTAGEffect::implement(GameObject *cst, SpellTarget *trg, int8) {
void ProtoObjectEffect::implement(GameObject *, SpellTarget *trg, int8) {
GameObject *go = trg->getObject();
VERIFY(go);
assert(go);
if (!isActor(go))
EnchantObject(go->thisID(), affectBit, dice.roll());
}
@ -278,7 +278,7 @@ void ProtoLocationEffect::implement(GameObject *, SpellTarget *, int8) {
// use a special spell on something
void ProtoSpecialEffect::implement(GameObject *cst, SpellTarget *trg, int8) {
VERIFY(handler);
assert(handler);
(*handler)(cst, trg);
}
@ -322,8 +322,8 @@ bool ProtoObjectEffect::applicable(SpellTarget &trg) {
#endif
void createSpellCallFrame(GameObject *go, SpellTarget *trg, scriptCallFrame &scf) {
VERIFY(go);
VERIFY(trg);
assert(go);
assert(trg);
scf.invokedObject = Nothing;
scf.enactor = go->thisID();
scf.directObject = Nothing;
@ -426,7 +426,7 @@ SPECIALSPELL(DeathSpell) {
ObjectID pID = cst->possessor();
if (pID != Nothing) {
Actor *p = (Actor *) GameObject::objectAddress(pID);
VERIFY(isActor(p));
assert(isActor(p));
offensiveNotification(p, (Actor *) trg->getObject());
}
}
@ -475,7 +475,7 @@ SPECIALSPELL(DispellProtections) {
ObjectID pID = cst->possessor();
if (pID != Nothing) {
Actor *p = (Actor *) GameObject::objectAddress(pID);
VERIFY(isActor(p));
assert(isActor(p));
offensiveNotification(p, (Actor *) trg->getObject());
}
}

View File

@ -318,9 +318,9 @@ enum effectSpecialTypes {
//
inline uint16 makeEnchantmentID(uint16 type, uint16 damtyp, int16 damamt) {
VERIFY(type < 8);
VERIFY(damtyp < 32);
VERIFY(damamt < 128 && damamt > -128);
assert(type < 8);
assert(damtyp < 32);
assert(damamt < 128 && damamt > -128);
return (type << 13) | (damtyp << 8) + (damamt + 128);
}

View File

@ -58,8 +58,8 @@ ObjectID EnchantObject(
ProtoObj *enchProto;
TilePoint slot;
VERIFY(enchantmentProto >= 0);
VERIFY(enchantmentProto < objectProtoCount);
assert(enchantmentProto >= 0);
assert(enchantmentProto < objectProtoCount);
enchProto = &objectProtos[ enchantmentProto ];
@ -86,8 +86,8 @@ ObjectID EnchantObject(
// Now, change the object base on enchantments
obj->evalEnchantments();
VERIFY(enchProto->containmentSet() & ProtoObj::isEnchantment);
VERIFY((ench->protoAddress(ench->thisID()))->containmentSet() & ProtoObj::isEnchantment);
assert(enchProto->containmentSet() & ProtoObj::isEnchantment);
assert((ench->protoAddress(ench->thisID()))->containmentSet() & ProtoObj::isEnchantment);
return ench->thisID();
}

View File

@ -448,7 +448,7 @@ void LabeledButton::drawClipped(
FloatingWindow::FloatingWindow(const Rect16 &r, uint16 ident, const char saveas[], AppFunc *cmd)
: DecoratedWindow(r, ident, saveas, cmd) {
VERIFY(db = NEW_UI DragBar(*this, Rect16(0, 0, r.width, r.height)));
assert(db = NEW_UI DragBar(*this, Rect16(0, 0, r.width, r.height)));
origPos.x = r.x;
origPos.y = r.y;

View File

@ -221,7 +221,7 @@ public:
frameSmoother::frameSmoother(int32 fps, uint32 perSec, uint32 now)
: frameCounter(perSec, now) {
ASSERT(fps);
assert(fps);
desiredFPS = fps;
historySize = fps * 5;
frameHistory = new float[historySize];

View File

@ -232,7 +232,7 @@ void gMousePointer::restore(void) {
**********************************************************************
*/
void gMousePointer::show(void) {
ASSERT(hideCount > 0);
assert(hideCount > 0);
if (--hideCount == 0) {
#if defined( USEWINDOWS )

View File

@ -88,7 +88,7 @@ void GrabInfo::grabObject(ObjectID objid, Intent in, int16 count) {
void GrabInfo::grabObject(GameObject *obj, Intent in, int16 count) {
char objText[ bufSize ];
ASSERT(!obj->isMoving());
assert(!obj->isMoving());
// set the number of items
setMoveCount(count);
@ -177,12 +177,12 @@ uint8 GrabInfo::setIntent(uint8 in) {
// Make the object given into the mouse pointer
void GrabInfo::setIcon(void) {
ASSERT(
assert(
pointerMap.size.x == 0
&& pointerMap.size.y == 0
&& pointerMap.data == NULL);
ASSERT(grabObj != NULL && isObject(grabObj));
assert(grabObj != NULL && isObject(grabObj));
Sprite *spr;
ProtoObj *proto;
@ -219,7 +219,7 @@ void GrabInfo::setIcon(void) {
}
void GrabInfo::clearIcon(void) {
ASSERT(grabObj == NULL);
assert(grabObj == NULL);
if (pointerMap.data != NULL) {
RDisposePtr(pointerMap.data);

View File

@ -121,7 +121,7 @@ uint8 *builtinObjectAddress(int16 segment, uint16 index) {
return (uint8 *)ActiveItem::activeItemAddress(index);
case builtinAbstract:
ASSERT(index > 0);
assert(index > 0);
if (lookupExport(index, segNum, segOff) == FALSE)
error("SAGA: Cannot take address of abtract class");
@ -195,7 +195,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
error("SAGA Failure: Attempt to call member function of invalid builtin type.\n");
}
// ASSERT( script > 0 );
// assert( script > 0 );
// Look up the vtable in the export table.
if (script != 0 && lookupExport(script, vtSeg, vtOffset)) {
@ -455,9 +455,9 @@ uint8 *Thread::strAddress(int strNum) {
uint16 *codeBase = (uint16 *)*codeSeg;
uint8 *strSeg = segmentAddress(codeBase[ 1 ], codeBase[ 2 ]);
ASSERT(strNum >= 0);
ASSERT(codeBase);
ASSERT(strSeg);
assert(strNum >= 0);
assert(codeBase);
assert(strSeg);
return strSeg + ((uint16 *)strSeg)[ strNum ];
}
@ -1161,7 +1161,7 @@ public:
// Return a pointer to a thread, given an ID
Thread *getThreadAddress(ThreadID id) {
ASSERT(id >= 0 && id < elementsof(array));
assert(id >= 0 && id < elementsof(array));
return array[ id ].getThread();
}
@ -1296,7 +1296,7 @@ void *ThreadList::newThread(void) {
// Place a new thread into the active list and return its pointer
void *ThreadList::newThread(ThreadID id) {
ASSERT(id >= 0 && id < elementsof(array));
assert(id >= 0 && id < elementsof(array));
ThreadPlaceHolder *tp;
@ -1427,7 +1427,7 @@ void loadSAGAThreads(SaveFileReader &saveGame) {
new (&threadList) ThreadList;
bufferPtr = threadList.restore(bufferPtr);
ASSERT((char *)bufferPtr == (char *)archiveBuffer
assert((char *)bufferPtr == (char *)archiveBuffer
+ saveGame.getChunkSize());
RDisposePtr(archiveBuffer);
@ -1502,7 +1502,7 @@ Thread::Thread(uint16 segNum, uint16 segOff, scriptCallFrame &args) {
if ((*codeSeg)[ programCounter.offset ] != op_enter)
error("SAGA failure: Invalid script entry point (export=%d) [segment=%d:%d]\n", lastExport, segNum, segOff);
// VERIFY ((*codeSeg)[ programCounter.offset ] == op_enter);
// assert ((*codeSeg)[ programCounter.offset ] == op_enter);
}
//-----------------------------------------------------------------------
@ -1754,7 +1754,7 @@ void initScripts(void) {
dataSegSize = RPtrSize(*dataSegment);
exportSegment = (UByteHandle)scriptRes->load(exportSegID, "saga export segmant");
ASSERT(exportSegment != NULL);
assert(exportSegment != NULL);
exportCount = (scriptRes->size(exportSegID) / sizeof(uint32)) + 1;
}
@ -1804,8 +1804,8 @@ static bool lookupExport(
uint32 segRef,
*exportBase = (uint32 *)(*exportSegment - 2);
ASSERT(entry > 0);
ASSERT(entry <= exportCount);
assert(entry > 0);
assert(entry <= exportCount);
segRef = exportBase[ entry ];
segOff = segRef >> 16,
@ -1832,7 +1832,7 @@ scriptResult runScript(uint16 exportEntryNum, scriptCallFrame &args) {
if (exportEntryNum < 0)
error("SAGA failure: Attempt to run script with invalid export ID %d.", exportEntryNum);
ASSERT(exportEntryNum > 0);
assert(exportEntryNum > 0);
lookupExport(exportEntryNum, segNum, segOff);
// Create a new thread
@ -1894,8 +1894,8 @@ scriptResult runMethod(
C_Call *cfunc;
// Make sure the C function number is OK
ASSERT(funcNum >= 0);
ASSERT(funcNum < globalCFuncs.numEntries);
assert(funcNum >= 0);
assert(funcNum < globalCFuncs.numEntries);
cfunc = globalCFuncs.table[ funcNum ];
// Build a temporary dummy thread
@ -1935,7 +1935,7 @@ scriptResult runObjectMethod(
scriptCallFrame &args) {
GameObject *obj;
VERIFY(obj = GameObject::objectAddress(id));
assert(obj = GameObject::objectAddress(id));
return runMethod(obj->scriptClass(),
builtinTypeObject,
@ -1953,7 +1953,7 @@ scriptResult runTagMethod(
scriptCallFrame &args) {
ActiveItemPtr aItem;
VERIFY(aItem = ActiveItem::activeItemAddress(index));
assert(aItem = ActiveItem::activeItemAddress(index));
if (!aItem->scriptClassID)
return scriptResultNoScript;

View File

@ -513,11 +513,11 @@ CPortrait::CPortrait(gMultCompButton **portraits,
const uint16 numPorts,
uint16 numBrothers) { // numBrothers = post 1
// do some checking
ASSERT(portraits);
ASSERT(indivPort);
assert(portraits);
assert(indivPort);
for (uint16 i = 0; i < numBrothers; i++) {
ASSERT(portraits[ i ]);
assert(portraits[ i ]);
};
buttons = portraits; // set the pointer for class
@ -532,7 +532,7 @@ CPortrait::CPortrait(gMultCompButton **portraits,
}
void CPortrait::setPortrait(uint16 brotherID) {
ASSERT(brotherID < _numViews + 1);
assert(brotherID < _numViews + 1);
// tell button to select and display new image
if (brotherID == uiIndiv) {
@ -553,7 +553,7 @@ void CPortrait::set(uint16 brotherID, PortraitType type) {
}
void CPortrait::ORset(uint16 brotherID, PortraitType type) { // brotherID = post 0
ASSERT(brotherID < _numViews + 1);
assert(brotherID < _numViews + 1);
if (type == currentState[ brotherID ]) {
currentState[ brotherID ] = normal;
@ -723,7 +723,7 @@ CStatusLine::CStatusLine(gPanelList &list,
CStatusLine::~CStatusLine(void) {
while (queueTail != queueHead) {
ASSERT(lineQueue[ queueTail ].text != NULL);
assert(lineQueue[ queueTail ].text != NULL);
RDisposePtr(lineQueue[ queueTail ].text);
queueTail = bump(queueTail);
@ -950,7 +950,7 @@ CManaIndicator::CManaIndicator(gPanelList &list) : gCompImage(list,
NULL,
0,
cmdManaInd) {
ASSERT(resFile);
assert(resFile);
// init the resource handle with the mana resource group
resContext = resFile->newContext(MKTAG('M', 'A', 'N', 'A'),
@ -1218,7 +1218,7 @@ void CManaIndicator::drawClipped(gPort &port,
}
bool CManaIndicator::needUpdate(PlayerActor *player) {
ASSERT(player);
assert(player);
// get the ability scores for this character
ActorAttributes *stats = player->getEffStats();
@ -1245,7 +1245,7 @@ bool CManaIndicator::needUpdate(PlayerActor *player) {
bool CManaIndicator::update(PlayerActor *player) {
ASSERT(player);
assert(player);
// get the ability scores for this character
ActorAttributes *stats = player->getEffStats();
@ -1422,7 +1422,7 @@ CHealthIndicator::~CHealthIndicator(void) {
// Recalculate and update the health star for a particular brother
void CHealthIndicator::updateStar(gCompImage *starCtl, int32 bro, int32 baseVitality, int32 curVitality) {
ASSERT(baseVitality >= 0);
assert(baseVitality >= 0);
int16 maxStar, imageIndex;
@ -1909,7 +1909,7 @@ inline T GetRatio(T curUnits, T maxUnits, T ratio) {
}
uint16 getWeightRatio(GameObject *obj, uint16 &maxRatio, bool bReturnMaxRatio = TRUE) {
ASSERT(isObject(obj) || isActor(obj));
assert(isObject(obj) || isActor(obj));
uint16 weight;
uint16 maxWeight;
@ -1933,7 +1933,7 @@ uint16 getWeightRatio(GameObject *obj, uint16 &maxRatio, bool bReturnMaxRatio =
uint16 getBulkRatio(GameObject *obj, uint16 &maxRatio, bool bReturnMaxRatio = TRUE) {
ASSERT(isObject(obj) || isActor(obj));
assert(isObject(obj) || isActor(obj));
uint16 maxBulk;
uint16 bulk;

View File

@ -350,7 +350,7 @@ inline bool file_exists(const char f[]) {
void nameHook(char *targ, const char *bpath, const char *, const char *fname) {
char filename[260] = "";
VERIFY(targ);
assert(targ);
if (strcmp(bpath, ".\\")) { //if env var set
strcpy(filename, bpath);

View File

@ -131,8 +131,8 @@ bool nonUsable(SkillProto *spell) {
//-----------------------------------------------------------------------
// test a target for viability in a given spell
bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, SkillProto *skill) {
VERIFY(enactor != NULL);
VERIFY(skill != NULL);
assert(enactor != NULL);
assert(skill != NULL);
SpellStuff &sp = spellBook[skill->getSpellID()];
int32 range = sp.getRange();
if (target != NULL && target->thisID() != Nothing) {
@ -196,7 +196,7 @@ bool canCast(GameObject *enactor, SkillProto *spell) {
#if NPC_MANA_CHECK
if (isActor(enactor)) {
Actor *a = (Actor *) enactor;
VERIFY(ami >= manaIDRed && ami <= manaIDViolet);
assert(ami >= manaIDRed && ami <= manaIDViolet);
if ((&a->effectiveStats.redMana)[ami] < amt)
return FALSE;
return TRUE;
@ -279,7 +279,7 @@ bool implementSpell(GameObject *enactor, Location &target, SkillProto *spell)
SpellID s = spell->getSpellID();
SpellStuff &sProto = spellBook[s];
VERIFY(sProto.shouldTarget(spellApplyLocation));
assert(sProto.shouldTarget(spellApplyLocation));
ActorManaID ami = (ActorManaID)(sProto.getManaType());
@ -318,8 +318,8 @@ bool implementSpell(GameObject *enactor, ActiveItem *target, SkillProto *spell)
if (sProto.shouldTarget(spellApplyLocation)) {
return implementSpell(enactor, l, spell);
}
VERIFY(sProto.shouldTarget(spellApplyTAG));
VERIFY(target->itemType == activeTypeInstance);
assert(sProto.shouldTarget(spellApplyTAG));
assert(target->itemType == activeTypeInstance);
ActorManaID ami = (ActorManaID)(sProto.getManaType());
@ -357,7 +357,7 @@ bool implementSpell(GameObject *enactor, GameObject *target, SkillProto *spell)
Location l = Location(target->getWorldLocation(), enactor->world()->thisID());
if (sProto.shouldTarget(spellApplyLocation))
return implementSpell(enactor, l, spell);
VERIFY(sProto.shouldTarget(spellApplyObject));
assert(sProto.shouldTarget(spellApplyObject));
ActorManaID ami = (ActorManaID)(sProto.getManaType());

View File

@ -80,8 +80,8 @@ int ActiveMission::findMission(ObjectID genID) {
}
ActiveMission *ActiveMission::missionAddress(int index) {
ASSERT(index >= 0);
ASSERT(index < elementsof(activeMissions));
assert(index >= 0);
assert(index < elementsof(activeMissions));
return &activeMissions[ index ];
}

View File

@ -99,7 +99,6 @@ MODULE_OBJS := \
tromode.o \
uidialog.o \
vbacksav.o \
verify.o \
video.o \
videobox.o \
videomem.o \

View File

@ -232,7 +232,7 @@ inline int16 spinRight(int16 dir, int16 amt = 1) {
// happens due to the point-sampled nature of the environment.
bool unstickObject(GameObject *obj) {
ASSERT(isObject(obj) || isActor(obj));
assert(isObject(obj) || isActor(obj));
TilePoint pos;
int height,
@ -402,7 +402,7 @@ MotionTaskList::MotionTaskList(void **buf) {
// active list
mt = (MotionTask *)free.remHead();
#if DEBUG
VERIFY(mt != NULL);
assert(mt != NULL);
#endif
list.addTail(*mt);
@ -1296,7 +1296,7 @@ void MotionTask::calcVelocity(const TilePoint &vector, int16 turns) {
// This initiates a motion task for turning an actor
void MotionTask::turn(Actor &obj, Direction dir) {
ASSERT(dir >= 0 && dir < 8);
assert(dir >= 0 && dir < 8);
MotionTask *mt;
@ -1879,7 +1879,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, ActiveItem &target) {
if ((mt = mTaskList.newTask(&a)) != NULL) {
if (mt->motionType != type) {
Location loc;
VERIFY(target.itemType == activeTypeInstance);
assert(target.itemType == activeTypeInstance);
mt->motionType = type;
mt->spellObj = &spell;
mt->targetTAG = &target;
@ -2543,7 +2543,7 @@ void MotionTask::walkAction(void) {
moveTaskDone = FALSE;
WalkType walkType = walkNormal;
ASSERT(isActor(object));
assert(isActor(object));
a = (Actor *)object;
aa = a->appearance;
@ -3558,7 +3558,7 @@ GameObject *MotionTask::blockingObject(Actor *thisAttacker) {
void MotionTask::fireBowAction(void) {
Actor *a = (Actor *)object;
ASSERT(a->leftHandObject != Nothing);
assert(a->leftHandObject != Nothing);
// Initialize the bow firing motion
if (flags & reset) {
@ -3695,7 +3695,7 @@ void MotionTask::castSpellAction(void) {
if (actionCounter == 0) {
if (spellObj) {
if (flags & TAGTarg) {
VERIFY(targetTAG->itemType == activeTypeInstance);
assert(targetTAG->itemType == activeTypeInstance);
spellObj->implementAction(spellObj->getSpellID(), a->thisID(), targetTAG->thisID());
} else if (flags & LocTarg) {
spellObj->implementAction(spellObj->getSpellID(), a->thisID(), targetLoc);
@ -4113,7 +4113,7 @@ void MotionTask::useMagicWeaponAction(void) {
spell = GameObject::objectAddress(magicWeapon->IDChild());
spellProto = (SkillProto *)spell->proto();
ASSERT(spellProto->containmentSet() & ProtoObj::isSkill);
assert(spellProto->containmentSet() & ProtoObj::isSkill);
// use the spell
spellProto->implementAction(

View File

@ -131,8 +131,8 @@ void createStackedImage(
gPixelMap **imageArray,
int *imageCenterArray,
int images) {
ASSERT(images != 0);
ASSERT(newImage->data == NULL);
assert(images != 0);
assert(newImage->data == NULL);
int i;
int newImageBytes,
@ -184,7 +184,7 @@ void createStackedImage(
// Dispose of an image created with createStackedImage
inline void disposeStackedImage(gPixelMap *image) {
ASSERT(image->data != NULL);
assert(image->data != NULL);
delete [] image->data;
image->data = NULL;
@ -363,8 +363,8 @@ void setMouseTextF(char *format, ...) {
// gauge on if necessary ).
void setMouseGauge(int numerator, int denominator) {
ASSERT(denominator != 0);
ASSERT(numerator <= denominator);
assert(denominator != 0);
assert(numerator <= denominator);
if (showGauge
&& numerator == gaugeNumerator

View File

@ -410,7 +410,7 @@ void toggleMusic(void) {
// hook used by videos
HDIGDRIVER &digitalAudioDriver(void) {
VERIFY(audio);
assert(audio);
return audio->dig;
}
@ -691,7 +691,7 @@ uint32 parse_res_id(char IDstr[]) {
uint32 a[5] = {0, 0, 0, 0, 0};
uint32 a2, res = 0;
uint32 i, j;
VERIFY(IDstr != NULL);
assert(IDstr != NULL);
if (strlen(IDstr)) {
for (i = 0, j = 0; i < strlen(IDstr); i++) {
if (IDstr[i] == ':') {

View File

@ -528,7 +528,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
nameBuf[ size - 1 ] = NULL;
ASSERT(strlen(objName()) < size - addTextSize);
assert(strlen(objName()) < size - addTextSize);
// check to see if this item is a physical object
// if so, then give the count of the item ( if stacked )
@ -600,7 +600,7 @@ void GameObject::objCursorText(char nameBuf[], const int8 size, int16 count) {
if (actorIDToPlayerID(aID, pID)) {
PlayerActor *player = getPlayerActorAddress(pID);
ASSERT(player);
assert(player);
int16 manaAmount;
int16 baseManaAmount;
@ -834,7 +834,7 @@ void GameObject::move(const Location &location, int16 num) {
int16 GameObject::getChargeType(void) {
ASSERT(prototype);
assert(prototype);
return prototype->getChargeType();
}
@ -846,7 +846,7 @@ void GameObject::recharge(void) {
// it's charges to maximum
if (getChargeType()) {
ProtoObj *po = GameObject::protoAddress(thisID());
VERIFY(po);
assert(po);
bParam = po->maxCharges;
}
}
@ -854,7 +854,7 @@ void GameObject::recharge(void) {
// take a charge
bool GameObject::deductCharge(ActorManaID manaID, uint16 manaCost) {
ProtoObj *po = GameObject::protoAddress(thisID());
VERIFY(po);
assert(po);
// if this is not a chargeable item, then return FALSE
if (!getChargeType()) {
@ -887,7 +887,7 @@ bool GameObject::deductCharge(ActorManaID manaID, uint16 manaCost) {
bool GameObject::hasCharge(ActorManaID manaID, uint16 manaCost) {
ProtoObj *po = GameObject::protoAddress(thisID());
VERIFY(po);
assert(po);
// if this is not a chargeable item, then return FALSE
if (!getChargeType()) {
@ -1016,7 +1016,7 @@ ObjectID GameObject::extractMerged(const Location &loc, int16 num) {
}
// massCount should never go negitive
ASSERT(massCount >= 0);
assert(massCount >= 0);
} else
return Nothing;
} else {
@ -1049,7 +1049,7 @@ GameObject *GameObject::extractMerged(int16 num) {
}
// massCount should never go negitive
ASSERT(massCount >= 0);
assert(massCount >= 0);
} else
return NULL;
} else {
@ -1277,7 +1277,7 @@ void GameObject::deleteObjectRecursive(void) {
// If this is an important object let's not delete it but try to drop
// it on the ground instead.
if (isImportant()) {
ASSERT((prototype->containmentSet() & ProtoObj::isTangible) != 0);
assert((prototype->containmentSet() & ProtoObj::isTangible) != 0);
// If the object is already in a world there's nothing to do.
if (isWorld(parentID))
@ -1539,9 +1539,9 @@ bool GameObject::getAvailableSlot(
TilePoint *tp,
bool canMerge,
GameObject **mergeObj) {
ASSERT(isObject(obj));
ASSERT(tp != NULL);
ASSERT(!canMerge || mergeObj != NULL);
assert(isObject(obj));
assert(tp != NULL);
assert(!canMerge || mergeObj != NULL);
if (prototype == NULL) return FALSE;
@ -1553,7 +1553,7 @@ bool GameObject::getAvailableSlot(
if ((objProto->containmentSet()
& (ProtoObj::isContainer | ProtoObj::isIntangible))
== (ProtoObj::isContainer | ProtoObj::isIntangible)) {
// ASSERT( isActor( obj ) );
// assert( isActor( obj ) );
// Set intangible container locations to -1, -1.
tp->u = -1;
@ -1601,8 +1601,8 @@ bool GameObject::placeObject(
ObjectID objID,
bool canMerge,
int16 num) {
ASSERT(isActor(enactor));
ASSERT(isObject(objID));
assert(isActor(enactor));
assert(isObject(objID));
TilePoint slot;
GameObject *obj = GameObject::objectAddress(objID),
@ -1622,7 +1622,7 @@ bool GameObject::placeObject(
// Drop the specified object on the ground in a semi-random location
void GameObject::dropInventoryObject(GameObject *obj, int16 count) {
ASSERT(isWorld(parentID));
assert(isWorld(parentID));
int16 dist;
int16 mapNum = getMapNum();
@ -1802,14 +1802,14 @@ bool GameObject::addTimer(TimerID id, int16 frameInterval) {
return FALSE;
}
ASSERT(timerList->getObject() == this);
assert(timerList->getObject() == this);
// Search the list to see if there is already a timer with same
// ID as the new timer. If so, remove it and delete it.
for (timerInList = (Timer *)timerList->first();
timerInList != NULL;
timerInList = (Timer *)timerInList->next()) {
ASSERT(timerInList->getObject() == this);
assert(timerInList->getObject() == this);
if (newTimer->thisID() == timerInList->thisID()) {
timerInList->remove();
@ -1896,14 +1896,14 @@ bool GameObject::addSensor(Sensor *newSensor) {
&& (sensorList = new SensorList(this)) == NULL)
return FALSE;
ASSERT(sensorList->getObject() == this);
assert(sensorList->getObject() == this);
// Search the list to see if there is already a sensor with same
// ID as the new sensor. If so, remove it and delete it.
for (sensorInList = (Sensor *)sensorList->first();
sensorInList != NULL;
sensorInList = (Sensor *)sensorInList->next()) {
ASSERT(sensorInList->getObject() == this);
assert(sensorInList->getObject() == this);
if (newSensor->thisID() == sensorInList->thisID()) {
sensorInList->remove();
@ -3156,7 +3156,7 @@ void Sector::activate(void) {
// actors in sector if activation count has reached zero.
void Sector::deactivate(void) {
ASSERT(activationCount != 0);
assert(activationCount != 0);
activationCount--;
}
@ -3331,8 +3331,8 @@ void loadActiveRegions(SaveFileReader &saveGame) {
SectorRegionObjectIterator::SectorRegionObjectIterator(GameWorld *world) :
searchWorld(world) {
ASSERT(searchWorld != NULL);
ASSERT(isWorld(searchWorld));
assert(searchWorld != NULL);
assert(isWorld(searchWorld));
minSector = TilePoint(0, 0, 0);
maxSector = searchWorld->sectorSize();
@ -3372,10 +3372,10 @@ ObjectID SectorRegionObjectIterator::first(GameObject **obj) {
// Return the next object found
ObjectID SectorRegionObjectIterator::next(GameObject **obj) {
ASSERT(sectorCoords.u >= minSector.u);
ASSERT(sectorCoords.v >= minSector.v);
ASSERT(sectorCoords.u < maxSector.u);
ASSERT(sectorCoords.v < maxSector.v);
assert(sectorCoords.u >= minSector.u);
assert(sectorCoords.v >= minSector.v);
assert(sectorCoords.u < maxSector.u);
assert(sectorCoords.v < maxSector.v);
ObjectID currentObjectID;
@ -3818,7 +3818,7 @@ bool ActiveRegionObjectIterator::nextActiveRegion(void) {
if (!(sectorBitMask & sectorBit)) {
currentRegionSectors--;
ASSERT(currentRegionSectors >= 0);
assert(currentRegionSectors >= 0);
// Set the bit in the bit mask indicating that this
// sector overlaps with a previouse active region
@ -3904,7 +3904,7 @@ ObjectID ActiveRegionObjectIterator::first(GameObject **obj) {
sectorCoords.u,
sectorCoords.v);
ASSERT(currentSector != NULL);
assert(currentSector != NULL);
currentObjectID = currentSector->childID;
currentObject = currentObjectID != Nothing
@ -3918,7 +3918,7 @@ ObjectID ActiveRegionObjectIterator::first(GameObject **obj) {
sectorCoords.u,
sectorCoords.v);
ASSERT(currentSector != NULL);
assert(currentSector != NULL);
currentObjectID = currentSector->childID;
currentObject = currentObjectID != Nothing
@ -3935,8 +3935,8 @@ ObjectID ActiveRegionObjectIterator::first(GameObject **obj) {
// Return the next object within the specified region
ObjectID ActiveRegionObjectIterator::next(GameObject **obj) {
ASSERT(activeRegionIndex >= 0);
ASSERT(activeRegionIndex < elementsof(activeRegionList));
assert(activeRegionIndex >= 0);
assert(activeRegionIndex < elementsof(activeRegionList));
ObjectID currentObjectID;
@ -3954,7 +3954,7 @@ ObjectID ActiveRegionObjectIterator::next(GameObject **obj) {
sectorCoords.u,
sectorCoords.v);
ASSERT(currentSector != NULL);
assert(currentSector != NULL);
currentObjectID = currentSector->childID;
currentObject = currentObjectID != Nothing
@ -4032,7 +4032,7 @@ ObjectID RecursiveContainerIterator::next(GameObject **obj) {
if (currentObj->IDChild()) {
subIter = NEW_ITER RecursiveContainerIterator(currentObj);
VERIFY(subIter);
assert(subIter);
return subIter->first(obj);
}
}
@ -4299,7 +4299,7 @@ int16 openMindType;
APPFUNC(cmdBrain) {
int16 part = clamp(0, ev.mouse.x * 3 / ev.panel->getExtent().width, 2);
//ASSERT( indivControls->getEnabled() );
//assert( indivControls->getEnabled() );
if (!indivControls->getEnabled())
return;
@ -4312,7 +4312,7 @@ APPFUNC(cmdBrain) {
openMindType = part;
ASSERT(container == indivCviewBot->containerObject);
assert(container == indivCviewBot->containerObject);
// Get the actor's mind container
while (iter.next(&item) != Nothing) {
@ -4498,21 +4498,21 @@ void doBackgroundSimulation(void) {
childID != Nothing;
childID = GameObject::objectAddress(childID)->IDNext())
count++;
VERIFY(objectLimboCount == count);
assert(objectLimboCount == count);
count = 0;
for (childID = GameObject::objectAddress(ActorLimbo)->IDChild();
childID != Nothing;
childID = GameObject::objectAddress(childID)->IDNext())
count++;
VERIFY(actorLimboCount == count);
assert(actorLimboCount == count);
count = 0;
for (childID = GameObject::objectAddress(ImportantLimbo)->IDChild();
childID != Nothing;
childID = GameObject::objectAddress(childID)->IDNext())
count++;
VERIFY(importantLimboCount == count);
assert(importantLimboCount == count);
#endif
int32 objectUpdateCount,
@ -4535,7 +4535,7 @@ void doBackgroundSimulation(void) {
// If object is not deleted, then tell that object to do
// a background update
if (obj->IDParent() > ImportantLimbo) {
ASSERT(obj->proto());
assert(obj->proto());
// If an object has been abandoned by the player,
// and is not sitting inside a container,
@ -4566,7 +4566,7 @@ void doBackgroundSimulation(void) {
// If actor is not deleted, then tell that actor to do
// a background update
if (a->IDParent() > ImportantLimbo) {
ASSERT(a->proto());
assert(a->proto());
a->proto()->doBackgroundUpdate(a);
}

View File

@ -793,7 +793,7 @@ public:
}
static uint32 IDtoMapNum(ObjectID id) {
VERIFY(isWorld(id));
assert(isWorld(id));
return ((GameWorld *)GameObject::objectAddress(id))->mapNum;
}
};
@ -918,8 +918,8 @@ public:
searchWorld(world),
minSector(sectorRegion.min),
maxSector(sectorRegion.max) {
ASSERT(searchWorld != NULL);
ASSERT(isWorld(searchWorld));
assert(searchWorld != NULL);
assert(isWorld(searchWorld));
}
protected:

View File

@ -103,7 +103,7 @@ bool ProtoObj::isMissile(void) {
// Simple use command
bool ProtoObj::use(ObjectID dObj, ObjectID enactor) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
int16 scriptResult;
@ -132,8 +132,8 @@ bool ProtoObj::useAction(ObjectID dObj, ObjectID enactor) {
// UseOn object command
bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, ObjectID item) {
ASSERT(dObj != Nothing);
ASSERT(item != Nothing);
assert(dObj != Nothing);
assert(item != Nothing);
int16 scriptResult;
@ -156,8 +156,8 @@ bool ProtoObj::useOnAction(ObjectID dObj, ObjectID enactor, ObjectID item) {
// UseOn active item command
bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, ActiveItem *item) {
ASSERT(dObj != Nothing);
ASSERT(item != NULL);
assert(dObj != Nothing);
assert(item != NULL);
int16 scrResult;
@ -193,8 +193,8 @@ bool ProtoObj::useOnAction(ObjectID dObj, ObjectID enactor, ActiveItem *item) {
// UseOn location command
bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, const Location &loc) {
ASSERT(dObj != Nothing);
ASSERT(loc != Nowhere && loc.context != Nothing);
assert(dObj != Nothing);
assert(loc != Nowhere && loc.context != Nothing);
/* int16 scrResult;
@ -256,7 +256,7 @@ bool ProtoObj::useSlotAvailable(GameObject *, Actor *) {
// Open this object
bool ProtoObj::open(ObjectID dObj, ObjectID enactor) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
int16 scriptResult;
@ -284,7 +284,7 @@ bool ProtoObj::openAction(ObjectID, ObjectID) {
// Close this object
bool ProtoObj::close(ObjectID dObj, ObjectID enactor) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
int16 scriptResult;
GameObject *dObjPtr = GameObject::objectAddress(dObj);
@ -308,8 +308,8 @@ bool ProtoObj::closeAction(ObjectID, ObjectID) {
// Take this object
bool ProtoObj::take(ObjectID dObj, ObjectID enactor, int16 num) {
ASSERT(dObj != Nothing);
ASSERT(mouseInfo.getObjectId() == Nothing);
assert(dObj != Nothing);
assert(mouseInfo.getObjectId() == Nothing);
// >>> this needs to be dynamic!
if (mass > 200 || bulk > 200) return FALSE;
@ -339,7 +339,7 @@ bool ProtoObj::takeAction(ObjectID, ObjectID, int16 num) {
// Drop this object at the specified location
bool ProtoObj::drop(ObjectID dObj, ObjectID enactor, const Location &loc, int16 num) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
if (!canDropAt(dObj, enactor, loc)) return FALSE;
@ -379,7 +379,7 @@ bool ProtoObj::dropAction(ObjectID, ObjectID, const Location &, int16) {
// drop an object onto another object and handle the result.
bool ProtoObj::dropOn(ObjectID dObj, ObjectID enactor, ObjectID target, int16 count) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
// this prevents objects from being dropped on themselves
if (target == dObj) return TRUE;
@ -416,9 +416,9 @@ bool ProtoObj::dropOn(
ActiveItem *target,
const Location &loc,
int16 num) {
ASSERT(dObj != Nothing);
ASSERT(target != NULL);
ASSERT(isWorld(loc.context));
assert(dObj != Nothing);
assert(target != NULL);
assert(isWorld(loc.context));
int16 scriptResult;
/*
@ -444,8 +444,8 @@ bool ProtoObj::dropOnAction(
// Strike another object with this object
bool ProtoObj::strike(ObjectID dObj, ObjectID enactor, ObjectID item) {
ASSERT(isObject(dObj) || isActor(dObj));
ASSERT(isObject(item) || isActor(item));
assert(isObject(dObj) || isActor(dObj));
assert(isObject(item) || isActor(item));
int16 scriptResult;
@ -466,8 +466,8 @@ bool ProtoObj::strikeAction(ObjectID, ObjectID, ObjectID) {
// Damage another object with this object
bool ProtoObj::damage(ObjectID dObj, ObjectID enactor, ObjectID target) {
ASSERT(isObject(dObj) || isActor(dObj));
ASSERT(isObject(target) || isActor(target));
assert(isObject(dObj) || isActor(dObj));
assert(isObject(target) || isActor(target));
int16 scriptResult;
@ -487,7 +487,7 @@ bool ProtoObj::damageAction(ObjectID, ObjectID, ObjectID) {
// Eat this object
bool ProtoObj::eat(ObjectID dObj, ObjectID enactor) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
int16 scriptResult;
@ -508,8 +508,8 @@ bool ProtoObj::eatAction(ObjectID, ObjectID) {
// Insert this object into another object
bool ProtoObj::insert(ObjectID dObj, ObjectID enactor, ObjectID item) {
ASSERT(dObj != Nothing);
ASSERT(item != Nothing);
assert(dObj != Nothing);
assert(item != Nothing);
int16 scriptResult;
@ -530,7 +530,7 @@ bool ProtoObj::insertAction(ObjectID, ObjectID, ObjectID) {
// Remove this object from the object it is in
bool ProtoObj::remove(ObjectID dObj, ObjectID enactor) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
int16 scriptResult;
@ -555,8 +555,8 @@ bool ProtoObj::acceptDrop(
ObjectID enactor,
ObjectID droppedObj,
int count) {
ASSERT(dObj != Nothing);
ASSERT(droppedObj != Nothing);
assert(dObj != Nothing);
assert(droppedObj != Nothing);
int16 scriptResult;
@ -626,7 +626,7 @@ bool ProtoObj::acceptHealing(
int8 pdm = perDieMod;
int16 damage = 0;
int16 scriptResult;
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
damage = absDamage;
if (dice)
for (int d = 0; d < abs(dice); d++)
@ -654,8 +654,8 @@ bool ProtoObj::acceptStrike(
ObjectID enactor,
ObjectID strikingObj,
uint8 skillIndex) {
ASSERT(dObj != Nothing);
ASSERT(strikingObj != Nothing);
assert(dObj != Nothing);
assert(strikingObj != Nothing);
int16 scriptResult;
@ -687,7 +687,7 @@ bool ProtoObj::acceptLockToggle(
ObjectID dObj,
ObjectID enactor,
uint8 keyCode) {
ASSERT(dObj != Nothing);
assert(dObj != Nothing);
int16 scriptResult;
@ -715,8 +715,8 @@ bool ProtoObj::acceptLockToggleAction(ObjectID, ObjectID, uint8) {
// Mix this object with another.
bool ProtoObj::acceptMix(ObjectID dObj, ObjectID enactor, ObjectID mixObj) {
ASSERT(dObj != Nothing);
ASSERT(mixObj != Nothing);
assert(dObj != Nothing);
assert(mixObj != Nothing);
int16 scriptResult;
@ -741,8 +741,8 @@ bool ProtoObj::acceptInsertion(
ObjectID enactor,
ObjectID item,
int16 count) {
ASSERT(dObj != Nothing);
ASSERT(item != Nothing);
assert(dObj != Nothing);
assert(item != Nothing);
if (!canContain(dObj, item)) return FALSE;
@ -770,8 +770,8 @@ bool ProtoObj::acceptInsertionAt(
ObjectID item,
const TilePoint &where,
int16 num) {
ASSERT(dObj != Nothing);
ASSERT(item != Nothing);
assert(dObj != Nothing);
assert(item != Nothing);
if (!canContainAt(dObj, item, where)) return FALSE;
@ -1022,7 +1022,7 @@ bool InventoryProto::canDropAt(
ObjectID,
ObjectID enactor,
const Location &loc) {
ASSERT(enactor != Nothing);
assert(enactor != Nothing);
// If we're not dropping it onto a world, we're okay
if (!isWorld(loc.context)) return TRUE;
@ -1045,9 +1045,9 @@ bool InventoryProto::dropAction(
ObjectID enactor,
const Location &loc,
int16 num) {
ASSERT(loc.context != Nothing);
ASSERT(dObj != Nothing);
ASSERT(enactor != Nothing);
assert(loc.context != Nothing);
assert(dObj != Nothing);
assert(enactor != Nothing);
GameObject *dObjPtr = GameObject::objectAddress(dObj);
Actor *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
@ -1147,9 +1147,9 @@ bool InventoryProto::dropOnAction(
ActiveItem *target,
const Location &loc,
int16 num) {
ASSERT(dObj != Nothing);
ASSERT(target != NULL);
ASSERT(isWorld(loc.context));
assert(dObj != Nothing);
assert(target != NULL);
assert(isWorld(loc.context));
if (drop(dObj, enactor, loc, num)) {
GameObject *dObjPtr = GameObject::objectAddress(dObj);
@ -1188,9 +1188,9 @@ bool InventoryProto::acceptStrikeAction(
ObjectID enactor,
ObjectID strikingObj,
uint8) {
ASSERT(isObject(dObj) || isActor(dObj));
ASSERT(isActor(enactor));
ASSERT(isObject(strikingObj) || isActor(strikingObj));
assert(isObject(dObj) || isActor(dObj));
assert(isActor(enactor));
assert(isObject(strikingObj) || isActor(strikingObj));
GameObject *weapon = GameObject::objectAddress(strikingObj);
@ -1259,7 +1259,7 @@ bool PhysicalContainerProto::openAction(ObjectID dObj, ObjectID) {
GameObject *dObjPtr = GameObject::objectAddress(dObj);
ASSERT(!dObjPtr->isOpen() && !dObjPtr->isLocked());
assert(!dObjPtr->isOpen() && !dObjPtr->isLocked());
cn = CreateContainerNode(dObj, FALSE);
cn->markForShow(); // Deferred open
@ -1272,8 +1272,8 @@ bool PhysicalContainerProto::closeAction(ObjectID dObj, ObjectID) {
GameObject *dObjPtr = GameObject::objectAddress(dObj);
ContainerNode *cn = globalContainerList.find(dObj, ContainerNode::physicalType);
ASSERT(dObjPtr->isOpen());
ASSERT(cn);
assert(dObjPtr->isOpen());
assert(cn);
// Delete the container (lazy delete)
cn->markForDelete();
@ -1312,8 +1312,8 @@ bool PhysicalContainerProto::acceptInsertionAction(
ObjectID enactor,
ObjectID item,
int16 num) {
ASSERT(isObject(dObj));
ASSERT(isObject(item));
assert(isObject(dObj));
assert(isObject(item));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
GameObject *itemPtr = GameObject::objectAddress(item);
@ -1346,8 +1346,8 @@ bool PhysicalContainerProto::acceptInsertionAtAction(
ObjectID item,
const TilePoint &where,
int16 num) {
ASSERT(isObject(dObj));
ASSERT(isObject(item));
assert(isObject(dObj));
assert(isObject(item));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
GameObject *itemPtr = GameObject::objectAddress(item);
@ -1442,7 +1442,7 @@ uint16 PhysicalContainerProto::bulkCapacity(GameObject *) {
// Put key into mouse with intention to use
bool KeyProto::setUseCursor(ObjectID dObj) {
ASSERT(mouseInfo.getObjectId() == Nothing);
assert(mouseInfo.getObjectId() == Nothing);
mouseInfo.copyObject(GameObject::objectAddress(dObj), GrabInfo::Use);
return TRUE;
}
@ -1549,8 +1549,8 @@ bool WeaponProto::isObjectBeingUsed(GameObject *obj) {
// Place weapon into right hand
bool MeleeWeaponProto::useAction(ObjectID dObj, ObjectID enactor) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
assert(isObject(dObj));
assert(isActor(enactor));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
Actor *a = (Actor *)GameObject::objectAddress(enactor);
@ -1593,9 +1593,9 @@ bool MeleeWeaponProto::strikeAction(
ObjectID dObj,
ObjectID enactor,
ObjectID item) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
ASSERT(isObject(item) || isActor(item));
assert(isObject(dObj));
assert(isActor(enactor));
assert(isObject(item) || isActor(item));
GameObject *itemPtr = GameObject::objectAddress(item);
ObjectSoundFXs *soundFXs;
@ -1615,9 +1615,9 @@ bool MeleeWeaponProto::damageAction(
ObjectID dObj,
ObjectID enactor,
ObjectID target) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
ASSERT(isObject(target) || isActor(target));
assert(isObject(dObj));
assert(isActor(enactor));
assert(isObject(target) || isActor(target));
Actor *a = (Actor *)GameObject::objectAddress(enactor);
ActorAttributes *effStats = a->getStats();
@ -1655,7 +1655,7 @@ bool MeleeWeaponProto::acceptDamageAction(
// Determine if this type of weapon must be wielded with two hands
// for the specified actor
bool MeleeWeaponProto::isTwoHanded(ObjectID attackerID) {
ASSERT(isActor(attackerID));
assert(isActor(attackerID));
Actor *attackerPtr = (Actor *)GameObject::objectAddress(attackerID);
ActorProto *attackerProto = (ActorProto *)attackerPtr->proto();
@ -1669,8 +1669,8 @@ bool MeleeWeaponProto::isTwoHanded(ObjectID attackerID) {
// Initiate a melee weapon attack motion
void MeleeWeaponProto::initiateAttack(ObjectID attacker, ObjectID target) {
ASSERT(isActor(attacker));
ASSERT(isObject(target) || isActor(target));
assert(isActor(attacker));
assert(isObject(target) || isActor(target));
Actor *attackerPtr = (Actor *)GameObject::objectAddress(attacker);
GameObject *targetPtr = GameObject::objectAddress(target);
@ -1687,9 +1687,9 @@ void MeleeWeaponProto::initiateDefense(
ObjectID defensiveObj,
ObjectID defender,
ObjectID attacker) {
ASSERT(isObject(defensiveObj));
ASSERT(isActor(defender));
ASSERT(isActor(attacker));
assert(isObject(defensiveObj));
assert(isActor(defender));
assert(isActor(attacker));
GameObject *weapon = GameObject::objectAddress(defensiveObj);
Actor *defenderPtr = (Actor *)GameObject::objectAddress(defender),
@ -1719,8 +1719,8 @@ uint8 MeleeWeaponProto::weaponRating(
ObjectID weaponID,
ObjectID wielderID,
ObjectID targetID) {
ASSERT(isActor(wielderID));
ASSERT(isObject(targetID) || isActor(targetID));
assert(isActor(wielderID));
assert(isObject(targetID) || isActor(targetID));
Actor *wielder = (Actor *)GameObject::objectAddress(wielderID);
@ -1761,12 +1761,12 @@ uint8 MeleeWeaponProto::getDamageSound(const ObjectSoundFXs &soundFXs) {
// specified actor
bool MeleeWeaponProto::useSlotAvailable(GameObject *obj, Actor *a) {
ASSERT(isObject(obj) && obj->proto() == this);
ASSERT(isActor(a));
assert(isObject(obj) && obj->proto() == this);
assert(isActor(a));
if (a->rightHandObject == Nothing) {
if (a->leftHandObject != Nothing) {
ASSERT(isObject(a->leftHandObject));
assert(isObject(a->leftHandObject));
GameObject *leftHandObjectPtr;
@ -1776,7 +1776,7 @@ bool MeleeWeaponProto::useSlotAvailable(GameObject *obj, Actor *a) {
}
return TRUE;
}
ASSERT(isObject(a->rightHandObject));
assert(isObject(a->rightHandObject));
return FALSE;
}
@ -1789,7 +1789,7 @@ bool MeleeWeaponProto::useSlotAvailable(GameObject *obj, Actor *a) {
// Get the value of the wielder's skill which applies to this weapon
uint8 BludgeoningWeaponProto::getSkillValue(ObjectID enactor) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
Actor *a;
ActorAttributes *effStats;
@ -1804,7 +1804,7 @@ uint8 BludgeoningWeaponProto::getSkillValue(ObjectID enactor) {
// Cause the user's associated skill to grow
void BludgeoningWeaponProto::applySkillGrowth(ObjectID enactor, uint8 points) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
PlayerActorID playerID;
@ -1826,7 +1826,7 @@ void BludgeoningWeaponProto::applySkillGrowth(ObjectID enactor, uint8 points) {
// Get the value of the wielder's skill which applies to this weapon
uint8 SlashingWeaponProto::getSkillValue(ObjectID enactor) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
Actor *a;
ActorAttributes *effStats;
@ -1841,7 +1841,7 @@ uint8 SlashingWeaponProto::getSkillValue(ObjectID enactor) {
// Cause the user's associated skill to grow
void SlashingWeaponProto::applySkillGrowth(ObjectID enactor, uint8 points) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
PlayerActorID playerID;
@ -1860,8 +1860,8 @@ void SlashingWeaponProto::applySkillGrowth(ObjectID enactor, uint8 points) {
* ==================================================================== */
bool BowProto::useAction(ObjectID dObj, ObjectID enactor) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
assert(isObject(dObj));
assert(isActor(enactor));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
Actor *a = (Actor *)GameObject::objectAddress(enactor);
@ -1887,8 +1887,8 @@ bool BowProto::isTwoHanded(ObjectID) {
// Initiate the bow firing motion
void BowProto::initiateAttack(ObjectID attacker, ObjectID target) {
ASSERT(isActor(attacker));
ASSERT(isObject(target) || isActor(target));
assert(isActor(attacker));
assert(isObject(target) || isActor(target));
Actor *attackerPtr = (Actor *)GameObject::objectAddress(attacker);
GameObject *targetPtr = GameObject::objectAddress(target);
@ -1898,8 +1898,8 @@ void BowProto::initiateAttack(ObjectID attacker, ObjectID target) {
// Grab an arrow from the actor's inventory
GameObject *BowProto::getProjectile(ObjectID weapon, ObjectID enactor) {
ASSERT(isObject(weapon));
ASSERT(isActor(enactor));
assert(isObject(weapon));
assert(isActor(enactor));
GameObject *obj,
*arrow = NULL;
@ -1929,8 +1929,8 @@ GameObject *BowProto::getProjectile(ObjectID weapon, ObjectID enactor) {
// specified actor
bool BowProto::useSlotAvailable(GameObject *obj, Actor *a) {
ASSERT(isObject(obj) && obj->proto() == this);
ASSERT(isActor(a));
assert(isObject(obj) && obj->proto() == this);
assert(isActor(a));
return a->leftHandObject == Nothing && a->rightHandObject == Nothing;
}
@ -1942,8 +1942,8 @@ uint8 BowProto::weaponRating(
ObjectID weaponID,
ObjectID wielderID,
ObjectID targetID) {
ASSERT(isActor(wielderID));
ASSERT(isObject(targetID) || isActor(targetID));
assert(isActor(wielderID));
assert(isObject(targetID) || isActor(targetID));
if (getProjectile(weaponID, wielderID) == NULL) return 0;
@ -1978,8 +1978,8 @@ int16 BowProto::fightStanceAction(ObjectID actor) {
* ==================================================================== */
bool WeaponWandProto::useAction(ObjectID dObj, ObjectID enactor) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
assert(isObject(dObj));
assert(isActor(enactor));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
Actor *a = (Actor *)GameObject::objectAddress(enactor);
@ -2005,8 +2005,8 @@ bool WeaponWandProto::isTwoHanded(ObjectID) {
// Initiate the use wand motion
void WeaponWandProto::initiateAttack(ObjectID attacker, ObjectID target) {
ASSERT(isActor(attacker));
ASSERT(isObject(target) || isActor(target));
assert(isActor(attacker));
assert(isObject(target) || isActor(target));
Actor *attackerPtr = (Actor *)GameObject::objectAddress(attacker);
GameObject *targetPtr = GameObject::objectAddress(target);
@ -2019,8 +2019,8 @@ void WeaponWandProto::initiateAttack(ObjectID attacker, ObjectID target) {
// specified actor
bool WeaponWandProto::useSlotAvailable(GameObject *obj, Actor *a) {
ASSERT(isObject(obj) && obj->proto() == this);
ASSERT(isActor(a));
assert(isObject(obj) && obj->proto() == this);
assert(isActor(a));
return a->leftHandObject == Nothing && a->rightHandObject == Nothing;
}
@ -2032,9 +2032,9 @@ uint8 WeaponWandProto::weaponRating(
ObjectID weaponID,
ObjectID wielderID,
ObjectID targetID) {
ASSERT(isObject(weaponID) || isActor(weaponID));
ASSERT(isActor(wielderID));
ASSERT(isObject(targetID) || isActor(targetID));
assert(isObject(weaponID) || isActor(weaponID));
assert(isActor(wielderID));
assert(isObject(targetID) || isActor(targetID));
Actor *wielder = (Actor *)GameObject::objectAddress(wielderID);
@ -2121,9 +2121,9 @@ bool ArrowProto::strikeAction(
ObjectID dObj,
ObjectID enactor,
ObjectID item) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
ASSERT(isObject(item) || isActor(item));
assert(isObject(dObj));
assert(isActor(enactor));
assert(isObject(item) || isActor(item));
Actor *a = (Actor *)GameObject::objectAddress(enactor);
GameObject *itemPtr = GameObject::objectAddress(item);
@ -2138,9 +2138,9 @@ bool ArrowProto::damageAction(
ObjectID dObj,
ObjectID enactor,
ObjectID target) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
ASSERT(isObject(target) || isActor(target));
assert(isObject(dObj));
assert(isActor(enactor));
assert(isObject(target) || isActor(target));
Actor *a = (Actor *)GameObject::objectAddress(enactor);
ActorAttributes *effStats = a->getStats();
@ -2168,7 +2168,7 @@ bool ArrowProto::damageAction(
// Cause the user's associated skill to grow
void ArrowProto::applySkillGrowth(ObjectID enactor, uint8 points) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
PlayerActorID playerID;
@ -2226,8 +2226,8 @@ bool ArmorProto::isObjectBeingUsed(GameObject *obj) {
// specified actor
bool ArmorProto::useSlotAvailable(GameObject *obj, Actor *a) {
ASSERT(isObject(obj) || obj->proto() == this);
ASSERT(isActor(a));
assert(isObject(obj) || obj->proto() == this);
assert(isActor(a));
return a->armorObjects[ whereWearable ] == Nothing;
}
@ -2236,14 +2236,14 @@ bool ArmorProto::useSlotAvailable(GameObject *obj, Actor *a) {
// "Wear" a piece of armor.
bool ArmorProto::useAction(ObjectID dObj, ObjectID enactor) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
assert(isObject(dObj));
assert(isActor(enactor));
PlayerActorID pID;
Actor *a = (Actor *)GameObject::objectAddress(enactor);
GameObject *obj = GameObject::objectAddress(dObj);
ASSERT(obj->proto() == this);
assert(obj->proto() == this);
if (enactor != obj->IDParent()) return FALSE;
@ -2269,8 +2269,8 @@ uint16 ShieldProto::containmentSet(void) {
// Place shield into left hand
bool ShieldProto::useAction(ObjectID dObj, ObjectID enactor) {
ASSERT(isObject(dObj));
ASSERT(isActor(enactor));
assert(isObject(dObj));
assert(isActor(enactor));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
Actor *a = (Actor *)GameObject::objectAddress(enactor);
@ -2278,7 +2278,7 @@ bool ShieldProto::useAction(ObjectID dObj, ObjectID enactor) {
if (enactor != dObjPtr->IDParent()) return FALSE;
if (a->rightHandObject != Nothing) {
ASSERT(isObject(a->rightHandObject));
assert(isObject(a->rightHandObject));
GameObject *rightHandObjectPtr =
GameObject::objectAddress(a->rightHandObject);
@ -2311,9 +2311,9 @@ void ShieldProto::initiateDefense(
ObjectID defensiveObj,
ObjectID defender,
ObjectID attacker) {
ASSERT(isObject(defensiveObj));
ASSERT(isActor(defender));
ASSERT(isActor(attacker));
assert(isObject(defensiveObj));
assert(isActor(defender));
assert(isActor(attacker));
GameObject *shield = GameObject::objectAddress(defensiveObj);
Actor *defenderPtr = (Actor *)GameObject::objectAddress(defender),
@ -2355,12 +2355,12 @@ bool ShieldProto::isObjectBeingUsed(GameObject *obj) {
// specified actor
bool ShieldProto::useSlotAvailable(GameObject *obj, Actor *a) {
ASSERT(isObject(obj) || obj->proto() == this);
ASSERT(isActor(a));
assert(isObject(obj) || obj->proto() == this);
assert(isActor(a));
if (a->leftHandObject == Nothing) {
if (a->rightHandObject != Nothing) {
ASSERT(isObject(a->rightHandObject));
assert(isObject(a->rightHandObject));
GameObject *rightHandObjectPtr;
@ -2378,7 +2378,7 @@ bool ShieldProto::useSlotAvailable(GameObject *obj, Actor *a) {
// Get the value of the user's skill which applies to this object
uint8 ShieldProto::getSkillValue(ObjectID enactor) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
Actor *a;
ActorAttributes *effStats;
@ -2393,7 +2393,7 @@ uint8 ShieldProto::getSkillValue(ObjectID enactor) {
// Cause the user's associated skill to grow
void ShieldProto::applySkillGrowth(ObjectID enactor, uint8 points) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
PlayerActorID playerID;
@ -2421,7 +2421,7 @@ uint8 ShieldProto::getDamageSound(const ObjectSoundFXs &soundFXs) {
// Put tool into mouse with intention to use
bool ToolProto::setUseCursor(ObjectID dObj) {
ASSERT(mouseInfo.getObjectId() == Nothing);
assert(mouseInfo.getObjectId() == Nothing);
mouseInfo.copyObject(GameObject::objectAddress(dObj), GrabInfo::Use);
return TRUE;
}
@ -2490,7 +2490,7 @@ uint16 IntangibleObjProto::containmentSet(void) {
}
bool IntangibleObjProto::useAction(ObjectID dObj, ObjectID enactor) {
ASSERT(isObject(dObj));
assert(isObject(dObj));
/* GameObject *obj = GameObject::objectAddress(dObj);
@ -2501,8 +2501,8 @@ bool IntangibleObjProto::useAction(ObjectID dObj, ObjectID enactor) {
}
bool IntangibleObjProto::takeAction(ObjectID dObj, ObjectID enactor, int16) {
ASSERT(isObject(dObj));
ASSERT(mouseInfo.getObjectId() == Nothing);
assert(isObject(dObj));
assert(mouseInfo.getObjectId() == Nothing);
GameObject *dObjPtr = GameObject::objectAddress(dObj);
@ -2527,9 +2527,9 @@ bool IntangibleObjProto::dropAction(
ObjectID enactor,
const Location &loc,
int16) {
ASSERT(isObject(dObj));
ASSERT(loc.context != Nothing);
ASSERT(!isWorld(loc.context));
assert(isObject(dObj));
assert(loc.context != Nothing);
assert(!isWorld(loc.context));
GameObject *container = GameObject::objectAddress(loc.context);
@ -2553,7 +2553,7 @@ bool IntangibleObjProto::acceptDropAction(
ObjectID enactor,
ObjectID droppedObj,
int) {
ASSERT(isObject(dObj));
assert(isObject(dObj));
GameObject *dObjPtr = GameObject::objectAddress(dObj);
@ -2685,7 +2685,7 @@ bool SkillProto::canDropAt(ObjectID, ObjectID, const Location &) {
}
bool SkillProto::dropAction(ObjectID dObj, ObjectID enactor, const Location &loc, int16 num) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
if (isWorld(loc.context)) {
Actor *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
@ -2700,8 +2700,8 @@ bool SkillProto::dropAction(ObjectID dObj, ObjectID enactor, const Location &lo
}
bool SkillProto::dropOnAction(ObjectID dObj, ObjectID enactor, ObjectID target, int count) {
ASSERT(isActor(enactor));
ASSERT(isObject(target) || isActor(target));
assert(isActor(enactor));
assert(isObject(target) || isActor(target));
GameObject *targetPtr = GameObject::objectAddress(target);
@ -2721,7 +2721,7 @@ bool SkillProto::dropOnAction(
ActiveItem *target,
const Location &loc,
int16 num) {
ASSERT(isActor(enactor));
assert(isActor(enactor));
if (target != NULL) {
Actor *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
@ -2768,7 +2768,7 @@ void EnchantmentProto::doBackgroundUpdate(GameObject *obj) {
int16 hitPoints = obj->getHitPoints(); // get hitpoints of enchant
GameObject *parentObj = obj->parent(); // get parent of enchantment
ASSERT(parentObj);
assert(parentObj);
// if this is a poison enchantment
// then hurt the victim
@ -2975,7 +2975,7 @@ void MissionGeneratorProto::doBackgroundUpdate(GameObject *obj) {
* ==================================================================== */
bool IntangibleContainerProto::canContain(ObjectID dObj, ObjectID item) {
ASSERT(isObject(item));
assert(isObject(item));
GameObject *itemPtr = GameObject::objectAddress(item);
@ -3019,7 +3019,7 @@ bool IntangibleContainerProto::closeAction(ObjectID dObj, ObjectID) {
GameObject *dObjPtr = GameObject::objectAddress(dObj);
ContainerNode *cn = globalContainerList.find(dObj, ContainerNode::mentalType);
ASSERT(cn);
assert(cn);
// Mark container for lazy deletion
cn->markForDelete();

View File

@ -69,7 +69,7 @@ public:
}
RESTYPE operator[](uint32 ind) {
// ASSERT (ind<handles);
// assert (ind<handles);
if (!locked[ind]) handle[ind] = rLoad(ind, FALSE);
return handle[ind];
}

View File

@ -1103,7 +1103,7 @@ void LockUI(bool state) {
lockUINest++;
} else {
lockUINest--;
ASSERT(lockUINest >= 0);
assert(lockUINest >= 0);
if (lockUINest <= 0) {
enableUIKeys(TRUE);
pointer.show();

View File

@ -178,8 +178,8 @@ public:
void fetchTileSection(const TilePoint &org, const TilePoint &a);
PathTilePosInfo *tilePos(const TilePoint &pos) {
ASSERT(pos.u >= origin.u && (pos.u - origin.u) < area.u);
ASSERT(pos.v >= origin.v && (pos.v - origin.v) < area.v);
assert(pos.u >= origin.u && (pos.u - origin.u) < area.u);
assert(pos.v >= origin.v && (pos.v - origin.v) < area.v);
return &array[(pos.u - origin.u) * area.v + pos.v - origin.v ];
}
};
@ -331,8 +331,8 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
tileReg.min.v = (tileReg.min.v + origin.v) & platMask;
tileReg.max.v = tileReg.min.v + offset.v;
ASSERT(tileReg.max.u <= platformWidth);
ASSERT(tileReg.max.v <= platformWidth);
assert(tileReg.max.u <= platformWidth);
assert(tileReg.max.v <= platformWidth);
// Compute the offset of base tile in metatile to origin
offset.u = ((subMeta.u >> 1) << platShift) - origin.u;
@ -353,14 +353,14 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
for (u = tileReg.min.u; u < tileReg.max.u; u++) {
PathTilePosInfo *arrRow = &array[(u + offset.u) * area.v ];
ASSERT(u >= 0);
ASSERT(u < platformWidth);
assert(u >= 0);
assert(u < platformWidth);
for (v = tileReg.min.v; v < tileReg.max.v; v++) {
int16 flagIndex = ((u & subMetaMask) << subMetaShift) | (v & subMetaMask);
ASSERT(v >= 0);
ASSERT(v < platformWidth);
assert(v >= 0);
assert(v < platformWidth);
if (!(tpFlags & (1 << flagIndex))) {
tpFlags |= (1 << flagIndex);
@ -378,7 +378,7 @@ void PathTileRegion::fetchSubMeta(const TilePoint &subMeta) {
TileRegion subMetaTag;
TileRef *stateData;
ASSERT((uint16)tr->tile <= activeItemIndexNullID);
assert((uint16)tr->tile <= activeItemIndexNullID);
groupItem = ActiveItem::activeItemAddress(
ActiveItemID(mapNum, tr->tile));
@ -537,10 +537,10 @@ PathArray::~PathArray(void) {
// be TRUE. If it fails to allocate a new cell it will throw
// a CellAllocationFailure.
PathCell *PathArray::makeCell(int plat, int uCoord, int vCoord, bool *newCell) {
ASSERT(plat >= 0 && plat < maxPlatforms);
ASSERT(uCoord >= 0 && uCoord < searchDiameter);
ASSERT(vCoord >= 0 && vCoord < searchDiameter);
ASSERT(newCell != NULL);
assert(plat >= 0 && plat < maxPlatforms);
assert(uCoord >= 0 && uCoord < searchDiameter);
assert(vCoord >= 0 && vCoord < searchDiameter);
assert(newCell != NULL);
// Compute the chunk coords
int chunkUCoord = uCoord >> 2,
@ -585,9 +585,9 @@ PathCell *PathArray::makeCell(int plat, int uCoord, int vCoord, bool *newCell) {
// Get a pointer to an existing cell. If the specified cell has
// not been created, it will return NULL.
PathCell *PathArray::getCell(int plat, int uCoord, int vCoord) {
ASSERT(plat >= 0 && plat < maxPlatforms);
ASSERT(uCoord >= 0 && uCoord < searchDiameter);
ASSERT(vCoord >= 0 && vCoord < searchDiameter);
assert(plat >= 0 && plat < maxPlatforms);
assert(uCoord >= 0 && uCoord < searchDiameter);
assert(vCoord >= 0 && vCoord < searchDiameter);
// Compute the chunk coords
int chunkUCoord = uCoord >> 2,
@ -612,9 +612,9 @@ PathCell *PathArray::getCell(int plat, int uCoord, int vCoord) {
}
void PathArray::deleteCell(int plat, int uCoord, int vCoord) {
ASSERT(plat >= 0 && plat < maxPlatforms);
ASSERT(uCoord >= 0 && uCoord < searchDiameter);
ASSERT(vCoord >= 0 && vCoord < searchDiameter);
assert(plat >= 0 && plat < maxPlatforms);
assert(uCoord >= 0 && uCoord < searchDiameter);
assert(vCoord >= 0 && vCoord < searchDiameter);
// Compute the chunk coords
int chunkUCoord = uCoord >> 2,
@ -1354,7 +1354,7 @@ static void push(
int cost,
int direction,
int8 platformDelta) {
ASSERT(cellArray != NULL);
assert(cellArray != NULL);
PathCell *cellPtr;
bool newCell;
@ -1367,7 +1367,7 @@ static void push(
cellPtr = cellArray->makeCell(platform, tp.u, tp.v, &newCell);
ASSERT(cellPtr != NULL);
assert(cellPtr != NULL);
// If the cell is already visited, only
// update it if it was less cost to get here.
@ -1542,12 +1542,12 @@ void PathRequest::initialize(void) {
for (curTileRegU = minTileRegU;
curTileRegU < maxTileRegU;
curTileRegU++) {
ASSERT(curTileRegU >= 0 && curTileRegU < searchDiameter);
assert(curTileRegU >= 0 && curTileRegU < searchDiameter);
for (curTileRegV = minTileRegV;
curTileRegV < maxTileRegV;
curTileRegV++) {
ASSERT(curTileRegV >= 0 && curTileRegV < searchDiameter);
assert(curTileRegV >= 0 && curTileRegV < searchDiameter);
VolumeLookupNode *node;
VolumeLookupNode **tablePtrPtr;
@ -1641,7 +1641,7 @@ void PathRequest::finish(void) {
if (bestLoc != Nowhere) {
cell = cellArray->getCell(bestPlatform, bestLoc.u, bestLoc.v);
ASSERT(cell != NULL);
assert(cell != NULL);
if (cell->direction != dirInvalid) {
res = &tempResult[ elementsof(tempResult) ];
@ -1652,7 +1652,7 @@ void PathRequest::finish(void) {
int16 reverseDir;
cell = cellArray->getCell(bestPlatform, bestLoc.u, bestLoc.v);
ASSERT(cell != NULL);
assert(cell != NULL);
if (cell->direction != dirInvalid) {
if (cell->direction != prevDir
@ -1676,10 +1676,10 @@ void PathRequest::finish(void) {
reverseDir = (cell->direction + 4) & 0x07;
bestLoc += tDirTable2[ reverseDir ];
ASSERT(bestLoc.u >= 0 && bestLoc.u < searchDiameter);
ASSERT(bestLoc.v >= 0 && bestLoc.v < searchDiameter);
assert(bestLoc.u >= 0 && bestLoc.u < searchDiameter);
assert(bestLoc.v >= 0 && bestLoc.v < searchDiameter);
bestPlatform -= cell->platformDelta;
ASSERT(bestPlatform >= 0 && bestPlatform < maxPlatforms);
assert(bestPlatform >= 0 && bestPlatform < maxPlatforms);
} else
break;
}
@ -1717,7 +1717,7 @@ void PathRequest::abort(void) {
static uint32 severePathFinderOverruns = 0;
PathResult PathRequest::findPath(void) {
ASSERT(cellArray != NULL);
assert(cellArray != NULL);
static const uint8 costTable[] =
{ 4, 10, 12, 16, 12, 10, 4, 0, 4, 10, 12, 16, 12, 10, 4, 0 };
@ -1732,9 +1732,9 @@ PathResult PathRequest::findPath(void) {
lastTick = gameTime;
while (queue.remove(qi)) {
ASSERT(cellArray->getCell(qi.platform, qi.u, qi.v) != NULL);
ASSERT(qi.u >= 1 && qi.u < searchDiameter - 1);
ASSERT(qi.v >= 1 && qi.v < searchDiameter - 1);
assert(cellArray->getCell(qi.platform, qi.u, qi.v) != NULL);
assert(qi.u >= 1 && qi.u < searchDiameter - 1);
assert(qi.v >= 1 && qi.v < searchDiameter - 1);
TilePoint centerTileCoords;
TilePoint *tDir;
@ -2049,7 +2049,7 @@ PathResult PathRequest::findPath(void) {
cost,
dir,
testPlatform - centerPlatform);
ASSERT(cellArray->getCell(centerPlatform, qi.u, qi.v) != NULL);
assert(cellArray->getCell(centerPlatform, qi.u, qi.v) != NULL);
big_continue:
;
@ -2493,7 +2493,7 @@ TilePoint selectNearbySite(
int32 minDist,
int32 maxDist,
bool offScreenOnly) { // TRUE if we want it off-screen
ASSERT(isWorld(worldID));
assert(isWorld(worldID));
TilePoint baseCoords,
baseTileCoords,

View File

@ -93,7 +93,7 @@ void PatrolRouteList::setRouteData(PatrolRouteData *data) {
currentRoute =
(PatrolRoute *) & (*currentRoute)[ currentRoute->vertices() ]) {
#if DEBUG
VERIFY(currentRoute->vertices() > 1);
assert(currentRoute->vertices() > 1);
#endif
warning("STUB: PatrolRouteList::setRouteData: unsafe arithmetics");
offsetArray[ i ] = 0; // FIXME: It was "currentRoute - routeData";

View File

@ -366,7 +366,7 @@ void PlayerActor::vitalityAdvance(uint8 points) {
}
}
ASSERT(baseStats.vitality < ActorAttributes::vitalityLimit);
assert(baseStats.vitality < ActorAttributes::vitalityLimit);
}
// this function will return a value of 0 - 4 to indicate
@ -492,7 +492,7 @@ ActorAttributes *PlayerActor::getEffStats(void) {
ActorAttributes *effStats = &actor->effectiveStats;
// valid?
ASSERT(effStats);
assert(effStats);
// return current stats for this player actor
return effStats;
@ -516,7 +516,7 @@ void PlayerActor::handleAttacked(void) {
// Return a pointer to a PlayerActor given it's ID
PlayerActor *getPlayerActorAddress(PlayerActorID id) {
ASSERT(id >= 0 && id < elementsof(playerList));
assert(id >= 0 && id < elementsof(playerList));
return &playerList[ id ];
}
@ -555,7 +555,7 @@ PlayerActorID getCenterActorPlayerID(void) {
void setCenterActor(PlayerActorID newCenter) {
extern void setEnchantmentDisplay(void);
ASSERT(newCenter < playerActors);
assert(newCenter < playerActors);
Actor *a = playerList[ newCenter ].getActor();
PlayerActorIterator iter;
@ -601,7 +601,7 @@ void setCenterActor(PlayerActorID newCenter) {
// Set a new center actor based upon an Actor address
void setCenterActor(Actor *newCenter) {
ASSERT(newCenter->disposition >= dispositionPlayer);
assert(newCenter->disposition >= dispositionPlayer);
setCenterActor(newCenter->disposition - dispositionPlayer);
}
@ -609,7 +609,7 @@ void setCenterActor(Actor *newCenter) {
// Set a new center actor based upon a PlayerActor address
void setCenterActor(PlayerActor *newCenter) {
ASSERT(newCenter >= playerList && newCenter < &playerList[ playerActors ]);
assert(newCenter >= playerList && newCenter < &playerList[ playerActors ]);
setCenterActor(newCenter - playerList);
}
@ -628,7 +628,7 @@ TilePoint centerActorCoords(void) {
// Set or clear a player's aggressive state
void setAggression(PlayerActorID player, bool aggression) {
ASSERT(player >= 0 && player < playerActors);
assert(player >= 0 && player < playerActors);
Actor *a = playerList[ player ].getActor();
@ -651,7 +651,7 @@ void setAggression(PlayerActorID player, bool aggression) {
// Determine if player actor is in an aggressive state
bool isAggressive(PlayerActorID player) {
ASSERT(player >= 0 && player < playerActors);
assert(player >= 0 && player < playerActors);
return playerList[ player ].isAggressive();
}
@ -703,7 +703,7 @@ void autoAdjustAggression(void) {
// Set a player actor's banding
void setBanded(PlayerActorID player, bool banded) {
ASSERT(player >= 0 && player < playerActors);
assert(player >= 0 && player < playerActors);
if (playerList[ player ].getActor()->isDead()) return;
@ -721,7 +721,7 @@ void setBanded(PlayerActorID player, bool banded) {
// Determine if a player actor is banded
bool isBanded(PlayerActorID player) {
ASSERT(player >= 0 && player < playerActors);
assert(player >= 0 && player < playerActors);
return playerList[ player ].isBanded();
}
@ -791,7 +791,7 @@ bool actorIDToPlayerID(ObjectID id, PlayerActorID &result) {
}
void handlePlayerActorDeath(PlayerActorID id) {
ASSERT(id >= 0 && id < playerActors);
assert(id >= 0 && id < playerActors);
if (getCenterActor()->isDead()) {
PlayerActor *newCenter;
@ -818,7 +818,7 @@ void handlePlayerActorDeath(PlayerActorID id) {
// to the center actor
void transportCenterBand(const Location &loc) {
ASSERT(isWorld(loc.context));
assert(isWorld(loc.context));
fadeDown();

View File

@ -111,7 +111,7 @@ public:
vitalityMemory(0) {
int i;
ASSERT(ActorAttributes::skillFracPointsPerLevel > 0); // this is used in a divide
assert(ActorAttributes::skillFracPointsPerLevel > 0); // this is used in a divide
memset(&baseStats, 0, sizeof(baseStats));

View File

@ -205,7 +205,7 @@ void PlayModeSetup(void) {
// for tile mode.
// NOTE: Make sure these are allocated first, so that they
// can over-ride other controls.
VERIFY(speakButtonControls = NEW_UI gPanelList(*mainWindow));
assert(speakButtonControls = NEW_UI gPanelList(*mainWindow));
// Create a control covering the map area.
speakButtonPanel = NEW_UI gGenericControl(*speakButtonControls,
@ -216,11 +216,11 @@ void PlayModeSetup(void) {
// Create a panelList to contain all controls created
// for play mode.
VERIFY(playControls = NEW_UI gPanelList(*mainWindow));
assert(playControls = NEW_UI gPanelList(*mainWindow));
// Create a panelList to contain all controls created
// for tile mode.
VERIFY(tileControls = NEW_UI gPanelList(*mainWindow));
assert(tileControls = NEW_UI gPanelList(*mainWindow));
// Create a panelList to contain all controls created
// for stage mode.

View File

@ -181,7 +181,7 @@ CompoundMetaTileProperty::CompoundMetaTileProperty(
// Allocate memory for a copy of the array
propertyArray = (MetaTileProperty **)malloc(arrayBytes);
#if DEBUG
VERIFY(propertyArray);
assert(propertyArray);
#endif
// Copy the array
memcpy(propertyArray, array, arrayBytes);

View File

@ -120,7 +120,7 @@ CompoundProperty< T >::CompoundProperty(
// Allocate memory to copy the array.
propertyArray = (Property< T > **)TALLOC(arrayBytes, memPropList);
#if DEBUG
VERIFY(propertyArray);
assert(propertyArray);
#endif
// Copy the array
memcpy(propertyArray, array, arrayBytes);

View File

@ -728,7 +728,7 @@ int16 scriptGameObjectAddProtaganistSensor(int16 *args) {
int16 scriptGameObjectAddSpecificActorSensor(int16 *args) {
OBJLOG(AddSpecificActorSensor);
ASSERT(isActor(args[ 2 ]));
assert(isActor(args[ 2 ]));
GameObject *obj = (GameObject *)thisThread->thisObject;
@ -748,7 +748,7 @@ int16 scriptGameObjectAddSpecificActorSensor(int16 *args) {
int16 scriptGameObjectAddSpecificObjectSensor(int16 *args) {
OBJLOG(AddSpecificObjectSensor);
ASSERT(isObject(args[ 2 ]) || isActor(args[ 2 ]));
assert(isObject(args[ 2 ]) || isActor(args[ 2 ]));
GameObject *obj = (GameObject *)thisThread->thisObject;
@ -854,7 +854,7 @@ int16 scriptGameObjectCanSenseProtaganist(int16 *args) {
int16 scriptGameObjectCanSenseSpecificActor(int16 *args) {
OBJLOG(CanSenseSpecificActor);
ASSERT(isActor(args[ 1 ]));
assert(isActor(args[ 1 ]));
GameObject *obj = (GameObject *)thisThread->thisObject;
SenseInfo info;
@ -881,7 +881,7 @@ int16 scriptGameObjectCanSenseSpecificActor(int16 *args) {
int16 scriptGameObjectCanSenseSpecificObject(int16 *args) {
OBJLOG(CanSenseSpecificObject);
ASSERT(isObject(args[ 1 ]) || isActor(args[ 1 ]));
assert(isObject(args[ 1 ]) || isActor(args[ 1 ]));
GameObject *obj = (GameObject *)thisThread->thisObject;
SenseInfo info;
@ -988,8 +988,8 @@ int16 scriptGameObjectSetMass(int16 *args) {
OBJLOG(SetMass);
GameObject *obj = (GameObject *)thisThread->thisObject;
// ASSERT( args[ 0 ] > 0 );
ASSERT(args[ 0 ] < maxuint16);
// assert( args[ 0 ] > 0 );
assert(args[ 0 ] < maxuint16);
if (obj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
obj->setExtra(args[ 0 ]);
@ -1565,7 +1565,7 @@ int16 scriptActorFaceTowards(int16 *args) {
int16 oldFacing = 0;
if (isActor((GameObject *)thisThread->thisObject)) {
ASSERT(isObject(args[ 0 ]) || isActor(args[ 0 ]));
assert(isObject(args[ 0 ]) || isActor(args[ 0 ]));
Actor *a = (Actor *)thisThread->thisObject;
@ -1611,7 +1611,7 @@ int16 scriptActorTurn(int16 *args) {
int16 scriptActorTurnTowards(int16 *args) {
OBJLOG(TurnTowards);
if (isActor((GameObject *)thisThread->thisObject)) {
ASSERT(isObject(args[ 0 ]) || isActor(args[ 0 ]));
assert(isObject(args[ 0 ]) || isActor(args[ 0 ]));
Actor *a = (Actor *)thisThread->thisObject;
@ -1766,7 +1766,7 @@ int16 scriptActorAssignBeNearLocation(int16 *args) {
int16 scriptActorAssignBeNearActor(int16 *args) {
OBJLOG(AssignBeNearActor);
if (isActor((GameObject *)thisThread->thisObject)) {
ASSERT(isActor(args[ 1 ]));
assert(isActor(args[ 1 ]));
Actor *a = (Actor *)thisThread->thisObject,
*targetActor;
@ -1795,7 +1795,7 @@ int16 scriptActorAssignBeNearActor(int16 *args) {
int16 scriptActorAssignKillActor(int16 *args) {
OBJLOG(AssignKillActor);
if (isActor((GameObject *)thisThread->thisObject)) {
ASSERT(isActor(args[ 1 ]));
assert(isActor(args[ 1 ]));
Actor *a = (Actor *)thisThread->thisObject,
*targetActor;
@ -1913,7 +1913,7 @@ int16 scriptActorBandWith(int16 *args) {
if (isActor((GameObject *)thisThread->thisObject)) {
Actor *a = (Actor *)thisThread->thisObject;
ASSERT(isActor(args[ 0 ]));
assert(isActor(args[ 0 ]));
a->bandWith((Actor *)GameObject::objectAddress(args[ 0 ]));
}
@ -1975,8 +1975,8 @@ int16 scriptActorGetFollower(int16 *args) {
if (isActor((GameObject *)thisThread->thisObject)) {
Actor *a = (Actor *)thisThread->thisObject;
ASSERT(a->followers != NULL);
ASSERT(args[ 0 ] < a->followers->size());
assert(a->followers != NULL);
assert(args[ 0 ] < a->followers->size());
return (*a->followers)[ args[ 0 ] ]->thisID();
}
@ -2406,10 +2406,10 @@ int16 scriptTagAssoc(int16 *args) {
ActiveItem *ai = (ActiveItem *)thisThread->thisObject;
int mapNum = ai->getMapNum();
ASSERT(args[ 0 ] >= 0);
ASSERT(args[ 0 ] < ai->numAssociations);
ASSERT(mapNum >= 0);
ASSERT(mapNum < 8);
assert(args[ 0 ] >= 0);
assert(args[ 0 ] < ai->numAssociations);
assert(mapNum >= 0);
assert(mapNum < 8);
return (*mapList[ mapNum ].assocList)[ ai->associationOffset + args[ 0 ] ];
}
@ -2527,8 +2527,8 @@ int16 scriptTagSetAnimation(int16 *args) {
tagLoc.z = ai->instance.h * 8 - a->getLocation().z;
#endif
// Assert that the state is valid
ASSERT(args[ 1 ] >= 0);
ASSERT(args[ 1 ] < ai->getGroup()->group.numStates);
assert(args[ 1 ] >= 0);
assert(args[ 1 ] < ai->getGroup()->group.numStates);
// If soundID is not NULL, then play the sound
if (soundID) playSoundAt(soundID, ail);
@ -2999,7 +2999,7 @@ int16 scriptDeleteObject(int16 *args) {
GameObject *obj = GameObject::objectAddress(args[ 0 ]);
ObjectID oldParentID;
VERIFY(obj);
assert(obj);
oldParentID = obj->IDParent();
obj->deleteObjectRecursive();
globalContainerList.setUpdate(oldParentID);
@ -3020,7 +3020,7 @@ int16 scriptMakeActor(int16 *args) {
int32 actorAppearanceNum;
Actor *a;
VERIFY(actorAppearanceName);
assert(actorAppearanceName);
memcpy(&actorAppearanceNum, actorAppearanceName, 4);
a = Actor::newActor(
@ -3095,7 +3095,7 @@ int16 scriptPlaySoundFrom(int16 *args) {
int32 soundID;
soundID = parse_res_id(sID);
GameObject *go = GameObject::objectAddress(args[1]);
ASSERT(go != NULL);
assert(go != NULL);
if (soundID) playSoundAt(soundID, go->notGetWorldLocation());
return 0;
@ -3198,10 +3198,10 @@ int16 scriptResID(int16 *args) {
int16 scriptWorldNum2Object(int16 *args) {
MONOLOG(WorldNum2Object);
ASSERT(args[ 0 ] >= 0);
assert(args[ 0 ] >= 0);
// REM: I can't seem to find a symbolic constant for the
// maximum number of worlds. I know that it's currently 8.
ASSERT(args[ 0 ] < 8);
assert(args[ 0 ] < 8);
return args[ 0 ] + WorldBaseID;
}
@ -3280,8 +3280,8 @@ int16 scriptAssertEvent(int16 *args) {
MONOLOG(AssertEvent);
GameEvent ev;
ASSERT(isObject(args[ 1 ]) || isActor(args[ 1 ]));
ASSERT(args[ 2 ] == Nothing
assert(isObject(args[ 1 ]) || isActor(args[ 1 ]));
assert(args[ 2 ] == Nothing
|| isObject(args[ 2 ])
|| isActor(args[ 2 ]));
@ -3332,8 +3332,8 @@ int16 scriptCanCast(int16 *args) {
MONOLOG(CanCast);
GameObject *caster = GameObject::objectAddress(*args++);
SkillProto *spell = skillProtoFromID(*args++);
VERIFY(caster);
VERIFY(spell);
assert(caster);
assert(spell);
return canCast(caster, spell);
}
@ -3342,9 +3342,9 @@ int16 scriptCastSpellAtObject(int16 *args) {
GameObject *caster = GameObject::objectAddress(*args++);
SkillProto *spell = skillProtoFromID(*args++);
GameObject *target = GameObject::objectAddress(*args++);
VERIFY(caster);
VERIFY(spell);
VERIFY(target);
assert(caster);
assert(spell);
assert(target);
castSpell(caster, target, spell);
return 0;
}
@ -3354,9 +3354,9 @@ int16 scriptCastSpellAtActor(int16 *args) {
GameObject *caster = GameObject::objectAddress(*args++);
SkillProto *spell = skillProtoFromID(*args++);
GameObject *target = GameObject::objectAddress(*args++);
VERIFY(caster);
VERIFY(spell);
VERIFY(target);
assert(caster);
assert(spell);
assert(target);
castSpell(caster, target, spell);
return 0;
}
@ -3365,8 +3365,8 @@ int16 scriptCastSpellAtWorld(int16 *args) {
MONOLOG(CastSpellAtWorld);
GameObject *caster = GameObject::objectAddress(*args++);
SkillProto *spell = skillProtoFromID(*args++);
VERIFY(caster);
VERIFY(spell);
assert(caster);
assert(spell);
castUntargetedSpell(caster, spell);
return 0;
}
@ -3376,9 +3376,9 @@ int16 scriptCastSpellAtTAG(int16 *args) {
GameObject *caster = GameObject::objectAddress(*args++);
SkillProto *spell = skillProtoFromID(*args++);
ActiveItem *ai = ActiveItem::activeItemAddress(*args++);
VERIFY(caster);
VERIFY(spell);
VERIFY(ai);
assert(caster);
assert(spell);
assert(ai);
castSpell(caster, ai, spell);
return 0;
}
@ -3391,8 +3391,8 @@ int16 scriptCastSpellAtTile(int16 *args) {
int16 v = *args++; // << tileUVShift;
int16 h = *args++;
Location l = Location(TilePoint(u, v, h), Nothing);
VERIFY(caster);
VERIFY(spell);
assert(caster);
assert(spell);
castSpell(caster, l, spell);
return 0;
}
@ -3529,9 +3529,9 @@ int16 scriptSearchRegion(int16 *args) {
maxP;
// Get a pointer to the world
ASSERT(isWorld(args[ 0 ]));
assert(isWorld(args[ 0 ]));
worldPtr = (GameWorld *)GameObject::objectAddress(args[ 0 ]);
ASSERT(worldPtr != NULL);
assert(worldPtr != NULL);
minP.u = MIN(args[ 1 ], args[ 3 ]);
minP.v = MIN(args[ 2 ], args[ 4 ]);
@ -3625,14 +3625,14 @@ int16 scriptSwapRegions(int16 *args) {
TileRegion region1,
region2;
ASSERT(isWorld(worldID1));
ASSERT(isWorld(worldID2));
assert(isWorld(worldID1));
assert(isWorld(worldID2));
worldPtr1 = (GameWorld *)GameObject::objectAddress(worldID1);
worldPtr2 = (GameWorld *)GameObject::objectAddress(worldID2);
ASSERT(worldPtr1 != NULL);
ASSERT(worldPtr2 != NULL);
assert(worldPtr1 != NULL);
assert(worldPtr2 != NULL);
region1.min.u = args[ 1 ];
region1.min.v = args[ 2 ];
@ -3654,9 +3654,9 @@ int16 scriptSwapRegions(int16 *args) {
// Allocate an array to hold object ID's for each region
objArray1 = new ObjectID[ objCount1 ];
ASSERT(objArray1);
assert(objArray1);
objArray2 = new ObjectID[ objCount2 ];
ASSERT(objArray2);
assert(objArray2);
// Get a list of the objects in each region
listObjectsInRegion(worldPtr1, region1, objArray1);
@ -3744,8 +3744,8 @@ extern int16 objectProtoCount;
int16 scriptNumTempActors(int16 *args) {
MONOLOG(NumTempActors);
ASSERT(args[ 0 ] >= 0);
ASSERT(args[ 0 ] < actorProtoCount);
assert(args[ 0 ] >= 0);
assert(args[ 0 ] < actorProtoCount);
return getTempActorCount(args[ 0 ]);
}
@ -3758,8 +3758,8 @@ int16 scriptGetObjectBasePrice(int16 *args) {
MONOLOG(GetBaseObjectPrice);
extern ProtoObj *objectProtos;
ASSERT(args[ 0 ] >= 0);
ASSERT(args[ 0 ] < objectProtoCount);
assert(args[ 0 ] >= 0);
assert(args[ 0 ] < objectProtoCount);
return objectProtos[ args[ 0 ] ].price;
}
@ -3807,7 +3807,7 @@ int16 scriptPlayVideo(int16 *args) {
int16 scriptDistanceBetween(int16 *args) {
MONOLOG(distanceBetween);
ASSERT((isObject(args[ 0 ]) || isActor(args[ 0 ]))
assert((isObject(args[ 0 ]) || isActor(args[ 0 ]))
&& (isObject(args[ 1 ]) || isActor(args[ 1 ])));
GameObject *obj1 = GameObject::objectAddress(args[ 0 ]),
@ -3824,7 +3824,7 @@ int16 scriptDistanceBetween(int16 *args) {
int16 scriptTransportCenterBand(int16 *args) {
MONOLOG(transportCenterBand);
ASSERT(isWorld(args[ 0 ]));
assert(isWorld(args[ 0 ]));
transportCenterBand(Location(args[ 1 ], args[ 2 ], args[ 3 ], args[ 0 ]));

View File

@ -92,7 +92,7 @@ bool SaveFileConstructor::newChunk(ChunkID id, int32 size) {
// Determine if file position is at end of previous chunk
if (posInChunk < chunkSize) return FALSE;
ASSERT(posInChunk == chunkSize);
assert(posInChunk == chunkSize);
SaveFileChunkInfo chunkHeader;
@ -137,7 +137,7 @@ bool SaveFileConstructor::writeChunk(ChunkID id, void *buf, int32 size) {
// Determine if file position is at end of previous chunk
if (posInChunk < chunkSize) return FALSE;
ASSERT(posInChunk == chunkSize);
assert(posInChunk == chunkSize);
SaveFileChunkInfo chunkHeader;
@ -224,7 +224,7 @@ bool SaveFileReader::firstChunk(ChunkID &chunk, int32 &size) {
// Make the next chunk the current chunk
bool SaveFileReader::nextChunk(ChunkID &chunk, int32 &size) {
ASSERT(posInChunk <= chunkSize);
assert(posInChunk <= chunkSize);
// If not already at the beginning of the next chunk header, seek
// the next chunk

View File

@ -191,12 +191,12 @@ void *constructSensor(int16 ctr, void *buf) {
break;
}
ASSERT(sensor != NULL);
assert(sensor != NULL);
// Get the sensor list
sensorList = fetchSensorList(sensor->getObject());
ASSERT(sensorList != NULL);
assert(sensorList != NULL);
// Append this Sensor to the sensor list
sensorList->addTail(*sensor);
@ -209,7 +209,7 @@ void *constructSensor(int16 ctr, void *buf) {
// an archive buffer
int32 sensorArchiveSize(Sensor *sensor) {
ASSERT(sensor != NULL);
assert(sensor != NULL);
return sizeof(int16) // Type
+ sensor->archiveSize();
@ -219,7 +219,7 @@ int32 sensorArchiveSize(Sensor *sensor) {
// Archive the specified Sensor in an archive buffer
void *archiveSensor(Sensor *sensor, void *buf) {
ASSERT(sensor != NULL);
assert(sensor != NULL);
// Store the sensor type
*((int16 *)buf) = sensor->getType();
@ -243,7 +243,7 @@ void checkSensors(void) {
nextSensorHolder = (SensorHolder *)sensorHolder->next();
if (--sensorHolder->checkCtr <= 0) {
ASSERT(sensorHolder->checkCtr == 0);
assert(sensorHolder->checkCtr == 0);
Sensor *sensor = sensorHolder->getSensor();
SenseInfo info;
@ -256,8 +256,8 @@ void checkSensors(void) {
if (sensor->check(info, sFlags)) {
ASSERT(info.sensedObject != NULL);
ASSERT(isObject(info.sensedObject)
assert(info.sensedObject != NULL);
assert(isObject(info.sensedObject)
|| isActor(info.sensedObject));
sensor->getObject()->senseObject(
@ -273,8 +273,8 @@ void checkSensors(void) {
//----------------------------------------------------------------------
void assertEvent(const GameEvent &ev) {
ASSERT(ev.directObject != NULL);
ASSERT(isObject(ev.directObject) || isActor(ev.directObject));
assert(ev.directObject != NULL);
assert(isObject(ev.directObject) || isActor(ev.directObject));
SensorHolder *sensorHolder,
*nextSensorHolder;
@ -303,12 +303,12 @@ void assertEvent(const GameEvent &ev) {
void initSensors(void) {
// Nothing to do
ASSERT(sizeof(ProtaganistSensor) <= maxSensorSize);
ASSERT(sizeof(SpecificObjectSensor) <= maxSensorSize);
ASSERT(sizeof(ObjectPropertySensor) <= maxSensorSize);
ASSERT(sizeof(SpecificActorSensor) <= maxSensorSize);
ASSERT(sizeof(ActorPropertySensor) <= maxSensorSize);
ASSERT(sizeof(EventSensor) <= maxSensorSize);
assert(sizeof(ProtaganistSensor) <= maxSensorSize);
assert(sizeof(SpecificObjectSensor) <= maxSensorSize);
assert(sizeof(ObjectPropertySensor) <= maxSensorSize);
assert(sizeof(SpecificActorSensor) <= maxSensorSize);
assert(sizeof(ActorPropertySensor) <= maxSensorSize);
assert(sizeof(EventSensor) <= maxSensorSize);
}
//----------------------------------------------------------------------
@ -374,7 +374,7 @@ void saveSensors(SaveFileConstructor &saveGame) {
bufferPtr = archiveSensor(sensorHolder->getSensor(), bufferPtr);
}
ASSERT(bufferPtr == &((uint8 *)archiveBuffer)[ archiveBufSize ]);
assert(bufferPtr == &((uint8 *)archiveBuffer)[ archiveBufSize ]);
// Write the data to the save file
saveGame.writeChunk(
@ -425,7 +425,7 @@ void loadSensors(SaveFileReader &saveGame) {
bufferPtr = constructSensor(ctr, bufferPtr);
}
ASSERT(bufferPtr == &((uint8 *)archiveBuffer)[ saveGame.getChunkSize() ]);
assert(bufferPtr == &((uint8 *)archiveBuffer)[ saveGame.getChunkSize() ]);
RDisposePtr(archiveBuffer);
}
@ -484,7 +484,7 @@ SensorList *fetchSensorList(GameObject *obj) {
SensorList::SensorList(void **buf) {
ObjectID *bufferPtr = (ObjectID *)*buf;
ASSERT(isObject(*bufferPtr) || isActor(*bufferPtr));
assert(isObject(*bufferPtr) || isActor(*bufferPtr));
obj = GameObject::objectAddress(*bufferPtr);
@ -511,7 +511,7 @@ void *SensorList::archive(void *buf) {
Sensor::Sensor(void **buf) {
void *bufferPtr = *buf;
ASSERT(isObject(*((ObjectID *)bufferPtr))
assert(isObject(*((ObjectID *)bufferPtr))
|| isActor(*((ObjectID *)bufferPtr)));
// Restore the object pointer
@ -559,13 +559,13 @@ void *Sensor::archive(void *buf) {
#if DEBUG
void *Sensor::operator new (size_t sz) {
ASSERT(sz <= maxSensorSize);
assert(sz <= maxSensorSize);
return newSensor();
}
void *Sensor::operator new (size_t sz, int16 ctr) {
ASSERT(sz <= maxSensorSize);
assert(sz <= maxSensorSize);
return newSensor(ctr);
}
@ -599,7 +599,7 @@ bool ProtaganistSensor::check(SenseInfo &info, uint32 senseFlags) {
Actor *protag =
getPlayerActorAddress(playerActorIDs[ i ])->getActor();
ASSERT(isActor(protag));
assert(isActor(protag));
// Skip this protaganist if they're dead
if (protag->isDead())
@ -755,8 +755,8 @@ int16 SpecificObjectSensor::getType(void) {
// Determine if the object can sense what it's looking for
bool SpecificObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
ASSERT(soughtObjID != Nothing);
ASSERT(isObject(soughtObjID) || isActor(soughtObjID));
assert(soughtObjID != Nothing);
assert(isObject(soughtObjID) || isActor(soughtObjID));
GameObject *soughtObject = GameObject::objectAddress(soughtObjID);
bool objIsActor = isActor(getObject());
@ -793,9 +793,9 @@ bool SpecificObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
// Determine if an object meets the search criteria
bool SpecificObjectSensor::isObjectSought(GameObject *obj) {
ASSERT(isObject(obj) || isActor(obj));
ASSERT(soughtObjID != Nothing);
ASSERT(isObject(soughtObjID) || isActor(soughtObjID));
assert(isObject(obj) || isActor(obj));
assert(soughtObjID != Nothing);
assert(isObject(soughtObjID) || isActor(soughtObjID));
return obj == GameObject::objectAddress(soughtObjID);
}
@ -849,7 +849,7 @@ int16 ObjectPropertySensor::getType(void) {
// Determine if an object meets the search criteria
bool ObjectPropertySensor::isObjectSought(GameObject *obj) {
ASSERT(isObject(obj) || isActor(obj));
assert(isObject(obj) || isActor(obj));
return obj->hasProperty(*getObjProp(objectProperty));
}
@ -862,7 +862,7 @@ bool ObjectPropertySensor::isObjectSought(GameObject *obj) {
// Determine if an object meets the search criteria
bool ActorSensor::isObjectSought(GameObject *obj) {
ASSERT(isObject(obj) || isActor(obj));
assert(isObject(obj) || isActor(obj));
// Only actors need apply
return isActor(obj) && isActorSought((Actor *)obj);
@ -878,7 +878,7 @@ bool ActorSensor::isObjectSought(GameObject *obj) {
SpecificActorSensor::SpecificActorSensor(void **buf) : ActorSensor(buf) {
ObjectID *bufferPtr = (ObjectID *)*buf;
ASSERT(isActor(*bufferPtr));
assert(isActor(*bufferPtr));
// Restore the sought actor pointer
soughtActor = (Actor *)GameObject::objectAddress(*bufferPtr++);
@ -918,7 +918,7 @@ int16 SpecificActorSensor::getType(void) {
// Determine if the object can sense what it's looking for
bool SpecificActorSensor::check(SenseInfo &info, uint32 senseFlags) {
ASSERT(isActor(soughtActor));
assert(isActor(soughtActor));
bool objIsActor = isActor(getObject());
if (senseFlags & (1 << actorBlind))

View File

@ -1049,7 +1049,7 @@ SpeechTaskList::SpeechTaskList(void **buf) {
// Restore the speeches
for (i = 0; i < count; i++) {
Speech *sp = (Speech *)free.remHead();
ASSERT(sp != NULL);
assert(sp != NULL);
nonActiveList.addTail(*sp);
bufferPtr = sp->restore(bufferPtr);

View File

@ -147,7 +147,7 @@ void SpellStuff::killEffects(void) {
// implement a spell - general target type
void SpellStuff::implement(GameObject *enactor, SpellTarget *target) {
VERIFY(target);
assert(target);
switch (target->getType()) {
case SpellTarget::spellTargetPoint:
implement(enactor, Location(target->getPoint(), Nothing));
@ -581,8 +581,8 @@ void SpellStuff::show(GameObject *, SpellTarget &) {}
// ctor
SpellInstance::SpellInstance(SpellCaster *newCaster, SpellTarget *newTarget, SpellID spellNo) {
VERIFY(newCaster);
VERIFY(newTarget);
assert(newCaster);
assert(newTarget);
caster = newCaster;
target = NEW_SPEL SpellTarget(*newTarget);
world = newCaster->world();
@ -594,7 +594,7 @@ SpellInstance::SpellInstance(SpellCaster *newCaster, SpellTarget *newTarget, Spe
// ctor
SpellInstance::SpellInstance(SpellCaster *newCaster, GameObject &newTarget, SpellID spellNo) {
VERIFY(newCaster);
assert(newCaster);
target = NEW_SPEL SpellTarget(newTarget);
caster = newCaster;
world = newCaster->world();
@ -606,8 +606,8 @@ SpellInstance::SpellInstance(SpellCaster *newCaster, GameObject &newTarget, Spel
// ctor
SpellInstance::SpellInstance(SpellCaster *newCaster, GameObject *newTarget, SpellID spellNo) {
VERIFY(newCaster);
VERIFY(newTarget);
assert(newCaster);
assert(newTarget);
target = NEW_SPEL SpellTarget(newTarget);
caster = newCaster;
world = newCaster->world();
@ -619,7 +619,7 @@ SpellInstance::SpellInstance(SpellCaster *newCaster, GameObject *newTarget, Spel
// ctor
SpellInstance::SpellInstance(SpellCaster *newCaster, TilePoint &newTarget, SpellID spellNo) {
VERIFY(newCaster);
assert(newCaster);
target = NEW_SPEL SpellTarget(newTarget);
caster = newCaster;
world = newCaster->world();
@ -655,7 +655,7 @@ void SpellInstance::init(void) {
age = 0;
implementAge = 0;
effSeq = 0;
VERIFY(dProto);
assert(dProto);
if (!dProto) return;
effect = EffectDisplayPrototypeList::edpList[dProto->effect];
implementAge = dProto->implementAge;

View File

@ -130,9 +130,9 @@ void initMagic(void) {
loadMagicData();
spellSprites = (SpriteSet **) spriteRes->load(spellSpriteID, "spell sprites");
VERIFY(spellSprites);
assert(spellSprites);
spellSchemes = (ColorScheme **)schemeRes->load(spellSpriteID, "scheme list");
VERIFY(spellSchemes);
assert(spellSchemes);
loadedColorMaps = schemeRes->size(spellSpriteID) / sizeof(ColorScheme);
}
@ -222,7 +222,7 @@ static void loadMagicData(void) {
RDisposePtr(rsi);
i++;
}
VERIFY(i > 1);
assert(i > 1);
// get spell effects
i = 0;
@ -243,7 +243,7 @@ static void loadMagicData(void) {
RDisposePtr(rse);
i++;
}
VERIFY(i > 1);
assert(i > 1);
// get spell color maps

View File

@ -109,7 +109,7 @@ typedef GameObject SpellCaster;
inline TilePoint TAGPos(ActiveItem *ai) {
if (ai == NULL) return Nowhere;
VERIFY(ai->itemType == activeTypeInstance);
assert(ai->itemType == activeTypeInstance);
return TilePoint(
ai->instance.u << tileUVShift,
ai->instance.v << tileUVShift,
@ -230,12 +230,12 @@ public:
}
GameObject *getObject(void) {
VERIFY(type == spellTargetObject);
assert(type == spellTargetObject);
return obj;
}
ActiveItem *getTAG(void) {
VERIFY(type == spellTargetTAG);
assert(type == spellTargetTAG);
return tag;
}

View File

@ -83,7 +83,7 @@ EffectDisplayPrototypeList::EffectDisplayPrototypeList(int32 c) {
effects = (pEffectDisplayPrototype *) TALLOC(sizeof(pEffectDisplayPrototype) * c, memSpells);
for (int i = 0; i < c; i++)
effects[i] = NULL;
VERIFY(effects);
assert(effects);
if (effects) maxCount = c;
}
@ -101,7 +101,7 @@ EffectDisplayPrototypeList::~EffectDisplayPrototypeList() {
}
int32 EffectDisplayPrototypeList::add(EffectDisplayPrototype *edp) {
VERIFY(count < maxCount);
assert(count < maxCount);
edp->setID(count);
effects[count++] = edp;
return count - 1;
@ -118,14 +118,14 @@ void EffectDisplayPrototypeList::cleanup(void) {
}
void EffectDisplayPrototypeList::append(EffectDisplayPrototype *nedp, int32 acount) {
VERIFY(acount < maxCount);
assert(acount < maxCount);
EffectDisplayPrototype *edp = effects[acount];
while (edp->next) edp = edp->next;
edp->next = nedp;
}
EffectDisplayPrototype *EffectDisplayPrototypeList::operator[](EffectID e) {
VERIFY(e >= 0 && e < maxCount);
assert(e >= 0 && e < maxCount);
return effects[e];
}
@ -155,7 +155,7 @@ SpellDisplayPrototype::SpellDisplayPrototype(
}
SpellDisplayPrototype *SpellDisplayPrototypeList::operator[](SpellID s) {
VERIFY(s >= 0 && s < count);
assert(s >= 0 && s < count);
return spells[s];
}
@ -195,7 +195,7 @@ SpellDisplayPrototypeList::SpellDisplayPrototypeList(uint16 s) {
spells = (pSpellDisplayPrototype *) TALLOC(sizeof(pSpellDisplayPrototype) * s, memSpells);
for (int i = 0; i < s; i++)
spells[i] = NULL;
VERIFY(spells);
assert(spells);
if (spells) maxCount = s;
}
@ -212,7 +212,7 @@ SpellDisplayPrototypeList::~SpellDisplayPrototypeList() {
}
int32 SpellDisplayPrototypeList::add(SpellDisplayPrototype *sdp) {
VERIFY(count < maxCount);
assert(count < maxCount);
sdp->setID((SpellID) count);
spells[count++] = sdp;
return count;
@ -253,7 +253,7 @@ void SpellDisplayList::cleanup(void) {
}
void SpellDisplayList::add(SpellInstance *newSpell) {
VERIFY(newSpell);
assert(newSpell);
if (count < maxCount)
spells[count++] = newSpell;
}
@ -273,7 +273,7 @@ void SpellDisplayList::updateStates(int32 deltaTime) {
}
void SpellDisplayList::tidyKill(uint16 spellNo) {
VERIFY(count);
assert(count);
if (spells[spellNo]) {
delete spells[spellNo];
spells[spellNo] = NULL;

View File

@ -96,7 +96,7 @@ void SpellStuff::setupFromResource(ResourceSpellItem *rsi) {
void SpellStuff::addEffect(ResourceSpellEffect *rse) {
ProtoEffect *pe;
VERIFY(rse && rse->spell == master);
assert(rse && rse->spell == master);
switch (rse->effectGroup) {
case effectNone :
return;
@ -305,7 +305,7 @@ SpellInstance::SpellInstance(StorageSpellInstance &ssi) {
caster = GameObject::objectAddress(ssi.caster);
target = NEW_SPEL SpellTarget(ssi.target);
GameObject *go = GameObject::objectAddress(ssi.world);
VERIFY(isWorld(go));
assert(isWorld(go));
world = (GameWorld *) go;
age = ssi.age;
spell = ssi.spell;
@ -353,7 +353,7 @@ void SpellDisplayList::load(SaveFileReader &saveGame) {
uint16 tCount;
saveGame.read(&tCount, sizeof(tCount));
VERIFY(tCount < maxCount);
assert(tCount < maxCount);
if (tCount) {
for (int i = 0; i < tCount; i++) {
SpellInstance *si;
@ -364,7 +364,7 @@ void SpellDisplayList::load(SaveFileReader &saveGame) {
si->loadEffect(saveGame, ssi.eListSize);
}
}
VERIFY(tCount == count);
assert(tCount == count);
}
void SpellDisplayList::wipe(void) {
@ -375,7 +375,7 @@ void SpellDisplayList::wipe(void) {
count--;
}
ASSERT(count == 0);
assert(count == 0);
}
size_t SpellInstance::saveSize(void) {
@ -397,7 +397,7 @@ void SpellInstance::saveEffect(SaveFileConstructor &saveGame) {
}
void SpellInstance::loadEffect(SaveFileReader &saveGame, uint16 eListSize) {
VERIFY(eListSize == effect->nodeCount);
assert(eListSize == effect->nodeCount);
eList.count = effect->nodeCount; //sdp->effCount;
if (eList.count)
for (int32 i = 0; i < eList.count; i++) {

View File

@ -744,21 +744,21 @@ void initSprites(void) {
error("Error accessing sprite resource group.");
frameRes = resFile->newContext(frameGroupID, "frame resources");
VERIFY(frameRes && frameRes->_valid);
assert(frameRes && frameRes->_valid);
poseRes = resFile->newContext(poseGroupID, "pose resources");
VERIFY(poseRes && poseRes->_valid);
assert(poseRes && poseRes->_valid);
schemeRes = resFile->newContext(schemeGroupID, "scheme resources");
VERIFY(schemeRes && schemeRes->_valid);
assert(schemeRes && schemeRes->_valid);
// object sprites
objectSprites = (SpriteSet **)spriteRes->load(objectSpriteID, "object sprites");
VERIFY(objectSprites);
assert(objectSprites);
// intagible object sprites
mentalSprites = (SpriteSet **)spriteRes->load(mentalSpriteID, "mental sprites");
VERIFY(mentalSprites);
assert(mentalSprites);
for (i = 0; i < maxWeaponSpriteSets; i++) {
hResID weaponSpriteID;

View File

@ -32,9 +32,6 @@
#include "saga2/rmemfta.h"
#include "saga2/saga2.h"
#define ASSERT assert // FIXME
#define VERIFY assert // FIXME
#define FTA
// #define LEAVE goto exitit // bail out of function

View File

@ -459,10 +459,10 @@ public:
// Constructors -- initial construction
SpecificObjectTarget(ObjectID id) :
obj(id) {
ASSERT(isObject(obj));
assert(isObject(obj));
}
SpecificObjectTarget(GameObject *ptr) :
obj((ASSERT(isObject(ptr)), ptr->thisID())) {
obj((assert(isObject(ptr)), ptr->thisID())) {
}
// Constructor -- reconstruct from archive buffer

View File

@ -164,7 +164,7 @@ public:
// Return a pointer to a TaskStack given a TaskStackID
TaskStack *getTaskStackAddress(TaskStackID id) {
ASSERT(id >= 0 && id < numTaskStacks);
assert(id >= 0 && id < numTaskStacks);
return array[ id ].getTaskStack();
}
@ -193,7 +193,7 @@ TaskStackList::TaskStackList(void) {
// TaskStackList destructor
TaskStackList::~TaskStackList(void) {
ASSERT(!lazyDelete);
assert(!lazyDelete);
TaskStackPlaceHolder *tsp;
TaskStackPlaceHolder *nextTsp;
@ -308,7 +308,7 @@ void *TaskStackList::newTaskStack(void) {
// Place a specific TaskStack into the active list and return its address
void *TaskStackList::newTaskStack(TaskStackID id) {
ASSERT(id >= 0 && id < elementsof(array));
assert(id >= 0 && id < elementsof(array));
TaskStackPlaceHolder *tsp;
@ -371,7 +371,7 @@ void TaskStackList::updateTaskStacks(void) {
// Update the task stack and delete it if it is done
if ((result = ts->update()) != taskNotDone) {
Actor *a = ts->getActor();
ASSERT(a != NULL);
assert(a != NULL);
a->handleTaskCompletion(result);
}
@ -526,7 +526,7 @@ void loadTaskStacks(SaveFileReader &saveGame) {
new (&stackList) TaskStackList;
bufferPtr = stackList.restore(bufferPtr);
ASSERT(bufferPtr == &((char *)archiveBuffer)[ archiveBufSize ]);
assert(bufferPtr == &((char *)archiveBuffer)[ archiveBufSize ]);
RDisposePtr(archiveBuffer);
}
@ -611,7 +611,7 @@ public:
// Return a pointer to a Task given a TaskID
Task *getTaskAddress(TaskID id) {
ASSERT(id >= 0 && id < numTasks);
assert(id >= 0 && id < numTasks);
return array[ id ].getTask();
}
@ -666,7 +666,7 @@ TaskList::~TaskList(void) {
// Reconstruct from an archive buffer
void *TaskList::restore(void *buf) {
ASSERT(list.first() == NULL);
assert(list.first() == NULL);
int16 i,
taskCount;
@ -782,7 +782,7 @@ void *TaskList::newTask(char *file, int line, TaskID id)
void *TaskList::newTask(TaskID id)
#endif
{
ASSERT(id >= 0 && id < elementsof(array));
assert(id >= 0 && id < elementsof(array));
TaskPlaceHolder *tp;
@ -944,7 +944,7 @@ void saveTasks(SaveFileConstructor &saveGame) {
bufferPtr = taskList.archive(bufferPtr);
ASSERT((uint8 *)bufferPtr - (uint8 *)archiveBuffer == archiveBufSize);
assert((uint8 *)bufferPtr - (uint8 *)archiveBuffer == archiveBufSize);
saveGame.writeChunk(
MakeID('T', 'A', 'S', 'K'),
@ -982,7 +982,7 @@ void loadTasks(SaveFileReader &saveGame) {
new (&taskList) TaskList;
bufferPtr = taskList.restore(bufferPtr);
ASSERT(bufferPtr == &((char *)archiveBuffer)[ archiveBufSize ]);
assert(bufferPtr == &((char *)archiveBuffer)[ archiveBufSize ]);
RDisposePtr(archiveBuffer);
}
@ -1183,12 +1183,12 @@ void *Task::archive(void *buf) const {
#if DEBUG
void *Task::operator new (size_t sz, char *file, int line) {
ASSERT(sz <= maxTaskSize);
assert(sz <= maxTaskSize);
return newTask(file, line);
}
void *Task::operator new (size_t sz, char *file, int line, TaskID id) {
ASSERT(sz <= maxTaskSize);
assert(sz <= maxTaskSize);
return newTask(file, line, id);
}
#endif
@ -2431,7 +2431,7 @@ GoAwayFromActorTask::GoAwayFromActorTask(
const ActorTarget &at,
bool runFlag) :
GoAwayFromTask(ts, runFlag) {
ASSERT(at.size() <= sizeof(targetMem));
assert(at.size() <= sizeof(targetMem));
// Copy the target to the target buffer
at.clone(targetMem);
}
@ -2703,7 +2703,7 @@ void HuntTask::removeGotoTask(void) {
HuntLocationTask::HuntLocationTask(TaskStack *ts, const Target &t) :
HuntTask(ts),
currentTarget(Nowhere) {
ASSERT(t.size() <= sizeof(targetMem));
assert(t.size() <= sizeof(targetMem));
// Copy the target to the target buffer
t.clone(targetMem);
}
@ -2892,7 +2892,7 @@ TaskResult HuntToBeNearLocationTask::atTargetUpdate(void) {
HuntObjectTask::HuntObjectTask(TaskStack *ts, const ObjectTarget &ot) :
HuntTask(ts),
currentTarget(NULL) {
ASSERT(ot.size() <= sizeof(targetMem));
assert(ot.size() <= sizeof(targetMem));
// Copy the target to the target buffer
ot.clone(targetMem);
}
@ -3270,7 +3270,7 @@ HuntActorTask::HuntActorTask(
HuntTask(ts),
flags(trackFlag ? track : 0),
currentTarget(NULL) {
ASSERT(at.size() <= sizeof(targetMem));
assert(at.size() <= sizeof(targetMem));
// Copy the target to the target buffer
at.clone(targetMem);
}
@ -3899,7 +3899,7 @@ TaskResult HuntToKillTask::atTargetEvaluate(void) {
//----------------------------------------------------------------------
TaskResult HuntToKillTask::atTargetUpdate(void) {
ASSERT(isActor(currentTarget));
assert(isActor(currentTarget));
Actor *a = stack->getActor();
@ -4093,7 +4093,7 @@ TaskResult HuntToGiveTask::atTargetUpdate(void) {
bool BandTask::BandingRepulsorIterator::first(
TilePoint &repulsorVector,
int16 &repulsorStrength) {
ASSERT(a->leader != NULL && a->leader->followers != NULL);
assert(a->leader != NULL && a->leader->followers != NULL);
band = a->leader->followers;
bandIndex = 0;
@ -4119,9 +4119,9 @@ bool BandTask::BandingRepulsorIterator::first(
bool BandTask::BandingRepulsorIterator::next(
TilePoint &repulsorVector,
int16 &repulsorStrength) {
ASSERT(a->leader != NULL && a->leader->followers != NULL);
ASSERT(band == a->leader->followers);
ASSERT(bandIndex < band->size());
assert(a->leader != NULL && a->leader->followers != NULL);
assert(band == a->leader->followers);
assert(bandIndex < band->size());
bandIndex++;
while (bandIndex < band->size()) {
@ -4420,7 +4420,7 @@ BandTask::RepulsorIterator *BandTask::getNewRepulsorIterator(void) {
bool BandTask::BandAndAvoidEnemiesRepulsorIterator::firstEnemyRepulsor(
TilePoint &repulsorVector,
int16 &repulsorStrength) {
ASSERT(iteratingThruEnemies);
assert(iteratingThruEnemies);
int16 actorDistArray[ elementsof(actorArray) ];
TargetActorArray taa(elementsof(actorArray), actorArray, actorDistArray);
@ -4428,7 +4428,7 @@ bool BandTask::BandAndAvoidEnemiesRepulsorIterator::firstEnemyRepulsor(
numActors = target.actor(a->world(), a->getLocation(), taa);
ASSERT(numActors == taa.actors);
assert(numActors == taa.actors);
actorIndex = 0;
@ -4449,7 +4449,7 @@ bool BandTask::BandAndAvoidEnemiesRepulsorIterator::firstEnemyRepulsor(
bool BandTask::BandAndAvoidEnemiesRepulsorIterator::nextEnemyRepulsor(
TilePoint &repulsorVector,
int16 &repulsorStrength) {
ASSERT(iteratingThruEnemies);
assert(iteratingThruEnemies);
actorIndex++;
@ -5154,7 +5154,7 @@ TaskResult ParryTask::update(void) {
return taskNotDone;
}
ASSERT(defenderMotion != NULL);
assert(defenderMotion != NULL);
// If the blow is about to strike, start the actual block
if (!(flags & blockStarted)
@ -5249,7 +5249,7 @@ void TaskStack::mark(void) {
// Set the bottom task of this task stack
void TaskStack::setTask(Task *t) {
ASSERT(stackBottomID == NoTask);
assert(stackBottomID == NoTask);
if (t->stack == this) {
TaskID id = getTaskID(t);

View File

@ -729,8 +729,8 @@ int16 tileSlopeHeight(
GameObject *obj,
StandingTileInfo *stiResult,
uint8 *platformResult) {
VERIFY(obj);
VERIFY(obj->proto());
assert(obj);
assert(obj->proto());
return tileSlopeHeight(
pt,
obj->getMapNum(),
@ -746,8 +746,8 @@ int16 tileSlopeHeight(
GameObject *obj,
StandingTileInfo *stiResult,
uint8 *platformResult) {
VERIFY(obj);
VERIFY(obj->proto());
assert(obj);
assert(obj->proto());
return tileSlopeHeight(
pt,
mapNum,

View File

@ -241,18 +241,18 @@ BankBits LoadedBanks; // what banks are loaded?
#if DEBUG
ActiveItemID::ActiveItemID(int16 m, int16 i) :
val((m << activeItemMapShift) | (i & activeItemIndexMask)) {
VERIFY(m < 0x8);
VERIFY((uint16)i <= activeItemIndexNullID);
assert(m < 0x8);
assert((uint16)i <= activeItemIndexNullID);
}
void ActiveItemID::setMapNum(int16 m) {
VERIFY(m < 0x8);
assert(m < 0x8);
val &= ~activeItemMapMask;
val |= (m << activeItemMapShift);
}
void ActiveItemID::setIndexNum(int16 i) {
VERIFY((uint16)i <= activeItemIndexNullID);
assert((uint16)i <= activeItemIndexNullID);
val &= ~activeItemIndexMask;
val |= i & activeItemIndexMask;
}
@ -359,7 +359,7 @@ int16 ActiveItem::getMapNum(void) {
ObjectID ActiveItem::getInstanceContext(void) {
int16 mn = getMapNum();
ASSERT(mn >= 0 && mn < 3);
assert(mn >= 0 && mn < 3);
if (mn < 0 || mn > 2)
return Nothing;
WorldMapData &map = mapList[mn]; // master map data array
@ -543,7 +543,7 @@ bool ActiveItem::use(ActiveItem *ins, ObjectID enactor) {
// trigger() function for ActiveItem group
bool ActiveItem::trigger(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
ASSERT(objID != Nothing);
assert(objID != Nothing);
GameObject *obj = GameObject::objectAddress(objID);
GameWorld *world = (GameWorld *)GameObject::objectAddress(
@ -655,7 +655,7 @@ bool ActiveItem::trigger(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
// release() function for ActiveItem group
bool ActiveItem::release(ActiveItem *ins, ObjectID enactor, ObjectID objID) {
ASSERT(objID != Nothing);
assert(objID != Nothing);
GameObject *obj = GameObject::objectAddress(objID);
GameWorld *world = (GameWorld *)GameObject::objectAddress(
@ -771,7 +771,7 @@ bool ActiveItem::acceptLockToggle(ActiveItem *ins, ObjectID enactor, uint8 keyCo
//-----------------------------------------------------------------------
TilePoint getClosestPointOnTAI(ActiveItem *TAI, GameObject *obj) {
ASSERT(TAI->itemType == activeTypeInstance);
assert(TAI->itemType == activeTypeInstance);
TilePoint objLoc = obj->getLocation(),
TAILoc;
@ -1738,7 +1738,7 @@ void loadAutoMap(SaveFileReader &saveGame) {
mapData = map->mapData;
for (mapIndex = 0; mapIndex < mapSize; mapIndex++) {
ASSERT((totalMapIndex >> 3) < archiveBufSize);
assert((totalMapIndex >> 3) < archiveBufSize);
// If the bit is set in the archive buffer, set the visited
// bit in the map data
@ -2213,8 +2213,8 @@ Platform *MetaTile::fetchPlatform(int16 mapNum, int16 layer) {
uint16 plIndex = stack[ layer ];
PlatformCacheEntry *pce;
ASSERT(layer >= 0);
ASSERT(this >= *mapList[ mapNum ].metaList
assert(layer >= 0);
assert(this >= *mapList[ mapNum ].metaList
&& this < & (*mapList[ mapNum ].metaList)[
mapList[ mapNum ].metaCount ]);
@ -2225,14 +2225,14 @@ Platform *MetaTile::fetchPlatform(int16 mapNum, int16 layer) {
else if (plIndex & cacheFlag) {
plIndex &= ~cacheFlag;
ASSERT(plIndex < platformCacheSize);
assert(plIndex < platformCacheSize);
// Get the address of the pce from the cache
pce = &platformCache[ plIndex ];
ASSERT(pce->platformNum >= 0);
ASSERT(pce->metaID != NoMetaTile);
ASSERT(pce->metaID == thisID(mapNum));
assert(pce->platformNum >= 0);
assert(pce->metaID != NoMetaTile);
assert(pce->metaID == thisID(mapNum));
// Move to the end of the LRU
pce->remove();
@ -2254,8 +2254,8 @@ Platform *MetaTile::fetchPlatform(int16 mapNum, int16 layer) {
// Compute the layer of this entry in the cache
cacheIndex = pce - platformCache;
ASSERT(cacheIndex < platformCacheSize);
ASSERT(cacheIndex >= 0);
assert(cacheIndex < platformCacheSize);
assert(cacheIndex >= 0);
// Now, flush the old mt from the cache.
// This assumes that all metatiles from all worlds are loaded.
@ -2263,8 +2263,8 @@ Platform *MetaTile::fetchPlatform(int16 mapNum, int16 layer) {
if (pce->metaID != NoMetaTile) {
MetaTile *oldMeta = metaTileAddress(pce->metaID);
ASSERT(pce->layerNum < maxPlatforms);
ASSERT(oldMeta->stack[ pce->layerNum ] == (cacheFlag | cacheIndex));
assert(pce->layerNum < maxPlatforms);
assert(oldMeta->stack[ pce->layerNum ] == (cacheFlag | cacheIndex));
oldMeta->stack[ pce->layerNum ] = pce->platformNum;
}
@ -2274,8 +2274,8 @@ Platform *MetaTile::fetchPlatform(int16 mapNum, int16 layer) {
pce->metaID = thisID(mapNum);
stack[ layer ] = (cacheFlag | cacheIndex);
ASSERT(plIndex >= 0);
ASSERT(plIndex * sizeof(Platform) < tileRes->size(platformID + RES_ID(0, 0, 0, mapNum)));
assert(plIndex >= 0);
assert(plIndex * sizeof(Platform) < tileRes->size(platformID + RES_ID(0, 0, 0, mapNum)));
// Now, load the actual metatile data...
if (tileRes->seek(platformID + RES_ID(0, 0, 0, mapNum))) {
@ -2379,8 +2379,8 @@ MetaTilePtr WorldMapData::lookupMeta(TilePoint coords) {
#endif
ASSERT(mtile < metaCount);
ASSERT(mtile >= 0);
assert(mtile < metaCount);
assert(mtile >= 0);
return &(*metaList)[ mtile ];
}
@ -3929,7 +3929,7 @@ bool pointOnHiddenSurface(
const TilePoint &tileCoords,
const TilePoint &pickCoords,
SurfaceType surfaceType) {
ASSERT(surfaceType == surfaceVertU || surfaceType == surfaceVertV);
assert(surfaceType == surfaceVertU || surfaceType == surfaceVertV);
WorldMapData *curMap = &mapList[ currentMapNum ];
@ -3956,11 +3956,11 @@ bool pointOnHiddenSurface(
// Determine the tile coordinates of adjacent tile and the mask
// of the subtile to test on that tile.
if (surfaceType == surfaceVertV) {
ASSERT(testCoords.u == 0);
assert(testCoords.u == 0);
adjTCoords.u--;
adjSubMask = 0x1000 << (testCoords.v >> subTileShift);
} else {
ASSERT(testCoords.v == 0);
assert(testCoords.v == 0);
adjTCoords.v--;
adjSubMask = 0x0008 << (testCoords.u & ~subTileMask);
}
@ -4356,7 +4356,7 @@ void loadTileCyclingStates(SaveFileReader &saveGame) {
initTileCyclingStates();
ASSERT(saveGame.getChunkSize() == sizeof(TileCycleArchive) * cycleCount);
assert(saveGame.getChunkSize() == sizeof(TileCycleArchive) * cycleCount);
archiveBuffer = (TileCycleArchive *)RNewPtr(
sizeof(TileCycleArchive) * cycleCount,
@ -4527,13 +4527,13 @@ void updateMainDisplay(void) {
int32 deltaTime = gameTime - lastUpdateTime;
ASSERT(isActor(viewCenterObject));
assert(isActor(viewCenterObject));
Actor *viewActor = (Actor *)GameObject::objectAddress(
viewCenterObject);
TilePoint viewDiff;
ASSERT(isWorld(viewActor->IDParent()));
assert(isWorld(viewActor->IDParent()));
GameWorld *viewWorld = (GameWorld *)viewActor->parent();

View File

@ -456,7 +456,7 @@ public:
// Return a pointer to this TAI's group
ActiveItem *getGroup(void) {
ASSERT(itemType == activeTypeInstance);
assert(itemType == activeTypeInstance);
return activeItemAddress(
ActiveItemID(getMapNum(), instance.groupID));
}

View File

@ -449,7 +449,7 @@ static void evalMouseState(void) {
// and if so, wether the other object is within the
// use range of the center actor
if (mouseInfo.getIntent() == GrabInfo::Use) {
ASSERT(obj != NULL);
assert(obj != NULL);
if (mObj->containmentSet() & (ProtoObj::isSkill | ProtoObj::isSpell)) {
GameObject *tob = pickedObject != Nothing ? obj : NULL;
@ -610,7 +610,7 @@ static void evalMouseState(void) {
// Initialize the tile mode state
void initTileModeState(void) {
ASSERT(uiKeysEnabled);
assert(uiKeysEnabled);
aggressiveActFlag = FALSE;
inCombat = FALSE;
@ -623,7 +623,7 @@ void initTileModeState(void) {
void saveTileModeState(SaveFileConstructor &saveGame) {
int32 size = 0;
ASSERT(uiKeysEnabled);
assert(uiKeysEnabled);
// Compute the number of bytes needed
size += sizeof(aggressiveActFlag)
@ -648,7 +648,7 @@ void saveTileModeState(SaveFileConstructor &saveGame) {
// Load the tile mode state from a save file
void loadTileModeState(SaveFileReader &saveGame) {
ASSERT(uiKeysEnabled);
assert(uiKeysEnabled);
// Simply read in the data
saveGame.read(&aggressiveActFlag, sizeof(aggressiveActFlag));

View File

@ -54,7 +54,7 @@ inline TilePoint rightVector(TilePoint tp, bool which = 0) {
inline void setMagnitude(TilePoint &tp, int32 newMag) {
#if DEBUG
VERIFY(tp.magnitude());
assert(tp.magnitude());
#else
if (tp.magnitude() == 0)
tp = TilePoint(1, 1, 0);

View File

@ -238,7 +238,7 @@ void saveTimers(SaveFileConstructor &saveGame) {
timerHolder = (TimerHolder *)timerHolder->next())
bufferPtr = timerHolder->getTimer()->archive(bufferPtr);
ASSERT(bufferPtr == &((uint8 *)archiveBuffer)[ archiveBufSize ]);
assert(bufferPtr == &((uint8 *)archiveBuffer)[ archiveBufSize ]);
// Write the data to the save file
saveGame.writeChunk(
@ -286,18 +286,18 @@ void loadTimers(SaveFileReader &saveGame) {
timer = new Timer(&bufferPtr);
ASSERT(timer != NULL);
assert(timer != NULL);
// Get the objects's timer list
timerList = fetchTimerList(timer->getObject());
ASSERT(timerList != NULL);
assert(timerList != NULL);
// Append this timer to the objects's timer list
timerList->addTail(*timer);
}
ASSERT(bufferPtr == &((uint8 *)archiveBuffer)[ saveGame.getChunkSize() ]);
assert(bufferPtr == &((uint8 *)archiveBuffer)[ saveGame.getChunkSize() ]);
RDisposePtr(archiveBuffer);
}
@ -340,7 +340,7 @@ void cleanupTimers(void) {
TimerList::TimerList(void **buf) {
ObjectID *bufferPtr = (ObjectID *)*buf;
ASSERT(isObject(*bufferPtr) || isActor(*bufferPtr));
assert(isObject(*bufferPtr) || isActor(*bufferPtr));
// Restore the object pointer
obj = GameObject::objectAddress(*bufferPtr++);
@ -369,7 +369,7 @@ void *TimerList::archive(void *buf) {
Timer::Timer(void **buf) {
void *bufferPtr = *buf;
ASSERT(isObject(*((ObjectID *)bufferPtr))
assert(isObject(*((ObjectID *)bufferPtr))
|| isActor(*((ObjectID *)bufferPtr)));
// Restore the object pointer

View File

@ -160,14 +160,6 @@ INITIALIZER(initErrorManagers) {
return true;
}
// defining VERIFY_EXIT will give you a message box when the program has
// been sucessfully cleaned up
#ifdef VERIFY_EXIT
#include "saga2/program.h"
#endif
TERMINATOR(termErrorManagers) {
}

View File

@ -1,134 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* aint32 with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Based on the original sources
* Faery Tale II -- The Halls of the Dead
* (c) 1993-1996 The Wyrmkeep Entertainment Co.
*/
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "saga2/std.h"
namespace Saga2 {
/****** errclass.cpp/VERIFY *******************************
*
* NAME
* VERIFY -- GTools-compatible assertion macro
*
* SYNOPSIS
* VERIFY( condition );
* verify( condition );
*
* FUNCTION
* Throws a gError exception if condition not met. It prints
* a message indicating the condition that was not met and
* the source file name and line number of the macro.
*
* SEE ALSO
* gError::gError
* gError::warn
* class gError
*
*******************************************************************/
void __verify(char *expr, char *file, long line, char *msg) {
if (msg) {
error("Error in %s, line %d: %s\n",
file,
line,
msg);
} else {
error("VERIFY failed in %s, line %d: (%s)\n",
file,
line,
expr);
}
}
//
// This value is set if the program is in the debugger & the extensions
// have initialized properly
//
volatile signed short int DebugExtensionsEnabled = 0;
//
// When DebugBreakNow is set to 1 a breakpoint is triggered
//
volatile signed short int DebugBreakNow = 0;
//
// Override these calls in an OBJ file to disable /enable stuff
//
void PauseTimers(void) { }
void ResumeTimers(void) { }
//
// Force a breakpoint
//
void debug_breakpoint(const int, const char []) {
PauseTimers();
DebugBreakNow = 1;
}
//
// When DebugDumpNow is set, anything in DebugDumpText will get
// dumped to the debugger LOG screen
//
volatile signed short int DebugDumpNow = 0;
char DebugDumpText[80] = "Run Time Messages Enabled\0";
//
// Set up & trigger a run-time error message
//
void debug_dumptext(const char text[]) {
int l;
l = strlen(text);
if (l > 78)
l = 78;
strncpy(DebugDumpText, text, l);
DebugDumpText[l] = '\0';
PauseTimers();
DebugDumpNow = 1;
ResumeTimers();
}
extern "C" {
void cebug_breakpoint(const int linenumber, const char filename[]) {
debug_breakpoint(linenumber, filename);
}
void cebug_dumptext(const char text[]) {
debug_dumptext(text);
}
};
} // end of namespace Saga2

View File

@ -211,7 +211,7 @@ bool VideoPlayer::StartPlay(char *filespec,
res = FALSE;
break;
default:
ASSERT(0);
assert(0);
res = FALSE;
}
mouseHook(TRUE);
@ -251,7 +251,7 @@ bool VideoPlayer::CheckPlay(void) {
case VideoNone:
break;
default:
ASSERT(0);
assert(0);
}
autoEnd = FALSE;
mouseHook(TRUE);
@ -282,7 +282,7 @@ void VideoPlayer::EndPlay(void) {
break;
#endif
default:
ASSERT(0);
assert(0);
}
mouseHook(TRUE);
setType(VideoNone);

View File

@ -127,7 +127,7 @@ void CVideoBox::draw(void) { // redraw the window
void CVideoBox::init(void) {
ASSERT(resFile);
assert(resFile);
// set the result info to nominal startup values
rInfo.result = -1;

View File

@ -187,7 +187,7 @@ bool VideoPlayer::StartSMK(char *filespec,
bool VideoPlayer::CheckSMK(void) {
#if 0
VERIFY(smk);
assert(smk);
if (abort)
i = smk->Frames + 1;
if (i > smk->Frames) {

View File

@ -244,7 +244,7 @@ void createPalette(
gPalettePtr dstP,
int32 elapsedTime,
int32 totalTime) {
ASSERT(totalTime != 0);
assert(totalTime != 0);
int i;
uint32 fadeProgress = (elapsedTime << 8) / totalTime;

View File

@ -170,7 +170,7 @@ WeaponStuff &getWeapon(weaponID i) {
//-----------------------------------------------------------------------
GameObject *getShieldItem(GameObject *defender) {
VERIFY(isActor(defender));
assert(isActor(defender));
Actor *a = (Actor *) defender;
GameObject *obj;
@ -206,9 +206,9 @@ void WeaponStrikeEffect::implement(
GameObject *target,
GameObject *strikingObj,
uint8 strength) {
ASSERT(isActor(enactor));
ASSERT(isObject(target) || isActor(target));
ASSERT(isObject(strikingObj) || isActor(strikingObj));
assert(isActor(enactor));
assert(isObject(target) || isActor(target));
assert(isObject(strikingObj) || isActor(strikingObj));
int8 totalDice,
totalBase;
@ -270,8 +270,8 @@ void WeaponStuff::addEffect(WeaponEffect *we) {
void WeaponStuff::addEffect(ResourceItemEffect *rie) {
WeaponEffect *we;
VERIFY(rie);
VERIFY(rie && rie->item == master);
assert(rie);
assert(rie && rie->item == master);
if (rie->effectGroup == effectStrike) {
we = NEW_EFCT WeaponStrikeEffect(
@ -344,7 +344,7 @@ static void loadWeaponData(void) {
i++;
}
loadedWeapons = i;
VERIFY(i > 1);
assert(i > 1);
auxResFile->disposeContext(spellRes);
}