diff options
author | Aki <please@ignore.pl> | 2024-03-10 15:00:41 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-10 15:00:41 +0100 |
commit | d55d9b1ef859ba940c75895fe198bcc4b19fa82b (patch) | |
tree | 50f57f840c63437d7f9460d4eb5d9d023b5533a7 | |
parent | 1f77780d8a2caa821fa2b1cbf35c7a9bfe06bebb (diff) | |
download | starshatter-d55d9b1ef859ba940c75895fe198bcc4b19fa82b.zip starshatter-d55d9b1ef859ba940c75895fe198bcc4b19fa82b.tar.gz starshatter-d55d9b1ef859ba940c75895fe198bcc4b19fa82b.tar.bz2 |
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.
-rw-r--r-- | StarsEx/Ship.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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; |