From d55d9b1ef859ba940c75895fe198bcc4b19fa82b Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 10 Mar 2024 15:00:41 +0100 Subject: Collisions will now always use the highest LOD model This fixes the good old carrier Goliath and Dragon docking bug for NPC fighters in campaigns. --- StarsEx/Ship.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'StarsEx') diff --git a/StarsEx/Ship.cpp b/StarsEx/Ship.cpp index 4f10eeb..bc30e88 100644 --- a/StarsEx/Ship.cpp +++ b/StarsEx/Ship.cpp @@ -1452,15 +1452,13 @@ Ship::CollidesWith(Physical& o) if (!o.Rep()) return 1; - for (int i = 0; i < detail.NumModels(detail_level); i++) { - Graphic* g = detail.GetRep(detail_level, i); + for (int i = 0; i < detail.NumModels(detail.NumLevels() - 1); i++) { + Graphic* g = detail.GetRep(detail.NumLevels() - 1, i); if (o.Type() == SimObject::SIM_SHIP) { Ship* o_ship = (Ship*) &o; - int o_det = o_ship->detail_level; - - for (int j = 0; j < o_ship->detail.NumModels(o_det); j++) { - Graphic* o_g = o_ship->detail.GetRep(o_det, j); + for (int j = 0; j < o_ship->detail.NumModels(o_ship->detail.NumLevels() - 1); j++) { + Graphic* o_g = o_ship->detail.GetRep(o_ship->detail.NumLevels() - 1, j); if (g->CollidesWith(*o_g)) return 1; -- cgit v1.1