From 8c19e05d40b2ccd02559d34c62adeb6a259562e1 Mon Sep 17 00:00:00 2001 From: hweimer <68769393+hweimer@users.noreply.github.com> Date: Mon, 8 May 2023 23:15:19 +0200 Subject: [PATCH 1/2] Fix equipment search for docking module Fixes a crash when GetEquipment cannot find the docking module because it is attached to the other pad. --- src/game/mc2.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/mc2.cpp b/src/game/mc2.cpp index 14f93a07..b15db553 100644 --- a/src/game/mc2.cpp +++ b/src/game/mc2.cpp @@ -196,6 +196,12 @@ char WhichPart(char plr, int which) Equipment *GetEquipment(const struct MisEval &Mev) { Equipment *e = MH[Mev.pad][Mev.Class]; + + // Some equipment like docking module can be attached to the other pad + if (!e) { + e = MH[other(Mev.pad)][Mev.Class]; + } + assert(e == Mev.Ep); return e; } From 37db1abbf545d0300de229a1cfe81ceb06fbf328 Mon Sep 17 00:00:00 2001 From: hweimer <68769393+hweimer@users.noreply.github.com> Date: Mon, 8 May 2023 23:15:19 +0200 Subject: [PATCH 2/2] Fix equipment search for docking module Fixes a crash when GetEquipment cannot find the docking module because it is attached to the other pad.