From 42efd418d172b19766330af1cf709aa27a18fb6a Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Sun, 21 Jan 2024 17:28:38 +0100 Subject: [PATCH] fix(VirtualObject): fix loading of rigid-body info --- src/vobs/VirtualObject.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/vobs/VirtualObject.cc b/src/vobs/VirtualObject.cc index f0a6f0f3..977572ed 100644 --- a/src/vobs/VirtualObject.cc +++ b/src/vobs/VirtualObject.cc @@ -99,11 +99,7 @@ namespace zenkit { // present but this is only relevant in save-games. has_event_manager_object = static_cast((bit1 & 0b000000000100000u) >> 5u) && r.is_save_game(); - if (version == GameVersion::GOTHIC_1) { - this->physics_enabled = static_cast((bit1 & 0b000000010000000u) >> 7u); - } else { - this->physics_enabled = static_cast((bit1 & 0b000000001000000u) >> 6u); - } + this->physics_enabled = static_cast((bit1 & 0b000000001000000u) >> 6u); if (version == GameVersion::GOTHIC_2) { this->anim_mode = static_cast(bit1 & 0b000000110000000u >> 7u); @@ -190,7 +186,7 @@ namespace zenkit { this->sleep_mode = r.read_byte(); // sleepMode this->next_on_timer = r.read_float(); // nextOnTimer - if (this->physics_enabled && version == GameVersion::GOTHIC_2) { + if (this->physics_enabled) { this->rigid_body.emplace().load(r, version); } } @@ -277,7 +273,7 @@ namespace zenkit { w.write_float("nextOnTimer", this->next_on_timer); // Gothic 1 does not store rigid-body information. - if (this->physics_enabled && this->rigid_body && version == GameVersion::GOTHIC_2) { + if (this->physics_enabled && this->rigid_body) { this->rigid_body->save(w, version); } }