diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 2a0f4bee..4060ac6c 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -5624,15 +5624,15 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other) return; // TOO FAR AWAY } + OOGL(glPushMatrix()); + if ([self status] == STATUS_ACTIVE) { - Vector abspos = position; // STATUS_ACTIVE means it is in control of it's own orientation + Vector abspos = position; // STATUS_ACTIVE means it is in control of its own orientation Entity *last = nil; Entity *father = [self owner]; OOMatrix r_mat; - OOGL(glPushMatrix()); - while ((father)&&(father != last) &&father != NO_TARGET) { r_mat = [father drawRotationMatrix]; @@ -5644,22 +5644,15 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other) GLLoadOOMatrix([UNIVERSE viewMatrix]); GLTranslateOOVector(abspos); - GLMultOOMatrix(rotMatrix); - [self drawImmediate:immediate translucent:translucent]; - - OOGL(glPopMatrix()); } else { - OOGL(glPushMatrix()); - GLTranslateOOVector(position); - GLMultOOMatrix(rotMatrix); - [self drawImmediate:immediate translucent:translucent]; - - OOGL(glPopMatrix()); } + GLMultOOMatrix(rotMatrix); + [self drawImmediate:immediate translucent:translucent]; + #ifndef NDEBUG if (gDebugFlags & DEBUG_BOUNDING_BOXES) { @@ -5667,6 +5660,8 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other) } #endif + OOGL(glPopMatrix()); + OOVerifyOpenGLState(); }