From 06a0de1c901c6b9333d84ed91b59927bc28f7162 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 16 Apr 2022 19:38:02 +0000 Subject: [PATCH] Remove write-only legacy trigger field `time` v29_trigger and v30_trigger define a field `time`. v29_trigger never initializes it. v30_trigger initializes it from the uninitialized v29_trigger in legacy mode, and from a file field otherwise. No program logic ever reads this member, so remove it. --- common/main/switch.h | 2 -- similar/main/switch.cpp | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/main/switch.h b/common/main/switch.h index 7a30162f2..b7eeca80d 100644 --- a/common/main/switch.h +++ b/common/main/switch.h @@ -110,7 +110,6 @@ struct v29_trigger : prohibit_void_ptr sbyte type; short flags; fix value; - fix time; sbyte link_num; short num_links; std::array seg; @@ -123,7 +122,6 @@ struct v30_trigger : prohibit_void_ptr sbyte num_links; sbyte pad; //keep alignment fix value; - fix time; std::array seg; std::array side; }; diff --git a/similar/main/switch.cpp b/similar/main/switch.cpp index f5f4d89d0..ce38e594a 100644 --- a/similar/main/switch.cpp +++ b/similar/main/switch.cpp @@ -645,7 +645,7 @@ extern void v30_trigger_read(v30_trigger *t, PHYSFS_File *fp) t->num_links = PHYSFSX_readByte(fp); t->pad = PHYSFSX_readByte(fp); t->value = PHYSFSX_readFix(fp); - t->time = PHYSFSX_readFix(fp); + PHYSFSX_readFix(fp); for (unsigned i=0; iseg[i] = PHYSFSX_readShort(fp); for (unsigned i=0; i