|
@@ -55,18 +55,18 @@ int World::getRoomByLocation(float x, float y, float z)
|
55
|
55
|
int hop = -1;
|
56
|
56
|
|
57
|
57
|
|
58
|
|
- for(std::vector<int>::size_type i = 0; i != mRooms.size(); i++)
|
|
58
|
+ for(std::vector<int>::size_type i = 0; i < mRooms.size(); i++)
|
59
|
59
|
{
|
60
|
60
|
room = mRooms[i];
|
61
|
61
|
|
62
|
62
|
if (!room)
|
63
|
63
|
continue;
|
64
|
64
|
|
65
|
|
- if (x > room->bbox_min[0] && x < room->bbox_max[0] &&
|
66
|
|
- z > room->bbox_min[2] && z < room->bbox_max[2])
|
|
65
|
+ if ((x > room->bbox_min[0]) && (x < room->bbox_max[0]) &&
|
|
66
|
+ (z > room->bbox_min[2]) && (z < room->bbox_max[2]))
|
67
|
67
|
{
|
68
|
68
|
// This room contains current position
|
69
|
|
- if (y > room->bbox_min[1] && y < room->bbox_max[1])
|
|
69
|
+ if ((y > room->bbox_min[1]) && (y < room->bbox_max[1]))
|
70
|
70
|
return i;
|
71
|
71
|
|
72
|
72
|
// This room is above or below current position
|
|
@@ -315,8 +315,7 @@ void World::setFlag(WorldFlag flag)
|
315
|
315
|
|
316
|
316
|
void World::clearFlag(WorldFlag flag)
|
317
|
317
|
{
|
318
|
|
- mFlags |= flag;
|
319
|
|
- mFlags ^= flag;
|
|
318
|
+ mFlags &= ~flag;
|
320
|
319
|
}
|
321
|
320
|
|
322
|
321
|
|
|
@@ -325,7 +324,8 @@ void World::destroy()
|
325
|
324
|
// Add some locking to check use state first
|
326
|
325
|
if (!mClearLock)
|
327
|
326
|
{
|
328
|
|
- clear();
|
|
327
|
+ //! \fixme Causes "freeing already freed pointer" exceptions or EXEC_BAD_ACCESS
|
|
328
|
+ //clear();
|
329
|
329
|
}
|
330
|
330
|
}
|
331
|
331
|
|
|
@@ -450,7 +450,7 @@ void World::moveEntity(entity_t *e, char movement)
|
450
|
450
|
e->pos[0], e->pos[1], e->pos[2],
|
451
|
451
|
x, y, z);
|
452
|
452
|
#else
|
453
|
|
- if (!mFlags & fEnableHopping)
|
|
453
|
+ if (!(mFlags & fEnableHopping))
|
454
|
454
|
{
|
455
|
455
|
mFlags |= fEnableHopping;
|
456
|
456
|
room = getRoomByLocation(e->room, x, y, z);
|