Skip to content

Commit d06f44a

Browse files
EmilyV99connorjclark
authored andcommitted
fix: being able to carry objects while swimming, when lift glove isn't swim-capable
1 parent 5ae6e3d commit d06f44a

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

resources/include/std_zh/std_constants.zh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3960,6 +3960,7 @@ enum //for Hero->LiftFlags[]
39603960
{
39613961
LIFTFL_DISABLE_SHIELD,
39623962
LIFTFL_DISABLE_ITEMS,
3963+
LIFTFL_NO_SWIMMING,
39633964
LIFTFL_MAX
39643965
};
39653966

src/base/qrs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ enum
182182
qr_BROKEN_LIGHTBEAM_HITBOX, qr_BROKEN_SWORD_SPIN_TRIGGERS, qr_SCRIPT_CONTHP_IS_HEARTS, qr_MULTI_PLATFORM_FFC,
183183
//54
184184
qr_SEPARATE_BOMBABLE_TAPPING_SFX, qr_BROKEN_BOMB_AMMO_COSTS, qr_CONVEYORS_ALL_LAYERS, qr_OLD_BROKEN_WARPEX_MUSIC,
185+
qr_BROKEN_LIFTSWIM,
185186
//EMILY SPOT
186187
//60
187188
//CONNOR SPOT qr_ = 60*8,

src/base/zdefs.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ enum {ENC_METHOD_192B104=0, ENC_METHOD_192B105, ENC_METHOD_192B185, ENC_METHOD_2
230230
#define V_SFX 8
231231
#define V_FAVORITES 4
232232

233-
#define V_COMPATRULE 62
233+
#define V_COMPATRULE 63
234234
#define V_ZINFO 3
235235

236236
//= V_SHOPS is under V_MISC
@@ -1531,7 +1531,8 @@ struct guydata
15311531

15321532
#define LIFTFL_DIS_SHIELD 0x00000001
15331533
#define LIFTFL_DIS_ITEMS 0x00000002
1534-
#define NUM_LIFTFL 2
1534+
#define LIFTFL_DIS_SWIMMING 0x00000004
1535+
#define NUM_LIFTFL 3
15351536

15361537
class refInfo
15371538
{

src/dialog/quest_rules.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,9 @@ static GUI::ListData compatRulesList
949949
{ "Broken Subscreen Ammo Costs", qr_BROKEN_BOMB_AMMO_COSTS,
950950
"If enabled, bombs/super bombs will check the bomb/sbomb counters to be usable,"
951951
" regardless of what their Cost Counters are set to." },
952+
{ "Broken Lifting/Swimming", qr_BROKEN_LIFTSWIM,
953+
"If enabled, lifted objects won't be dropped when swimming, even when lift gloves are set"
954+
" to not allow lifting while swimming." },
952955
};
953956

954957
static GUI::ListData enemiesRulesList
@@ -1775,7 +1778,7 @@ void applyRuleTemplate(int32_t ruleTemplate, byte* qrptr)
17751778
}
17761779
default: return;
17771780
}
1778-
if(qrptr == quest_rules)
1781+
if(qrptr == quest_rules || !qrptr)
17791782
saved = false;
17801783
}
17811784

src/qst.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,6 +3733,8 @@ int32_t readrules(PACKFILE *f, zquestheader *Header)
37333733
set_qr(qr_BROKEN_BOMB_AMMO_COSTS,1);
37343734
if(compatrule_version < 62)
37353735
set_qr(qr_OLD_BROKEN_WARPEX_MUSIC,1);
3736+
if(compatrule_version < 63)
3737+
set_qr(qr_BROKEN_LIFTSWIM,1);
37363738

37373739
set_qr(qr_ANIMATECUSTOMWEAPONS,0);
37383740
if (s_version < 16)

src/zc/hero.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ void HeroClass::set_liftflags(int liftid)
369369
if(unsigned(liftid) >= MAXITEMS)
370370
return;
371371
itemdata const& itm = itemsbuf[liftid];
372+
SETFLAG(liftflags, LIFTFL_DIS_SWIMMING, !(itm.flags & ITEM_FLAG2));
372373
SETFLAG(liftflags, LIFTFL_DIS_SHIELD, itm.flags & ITEM_FLAG3);
373374
SETFLAG(liftflags, LIFTFL_DIS_ITEMS, itm.flags & ITEM_FLAG4);
374375
}
@@ -10084,6 +10085,8 @@ heroanimate_skip_liftwpn:;
1008410085
action=falling; FFCore.setHeroAction(falling);
1008510086
}
1008610087

10088+
if(isSwimming() && (liftflags&LIFTFL_DIS_SWIMMING) && !get_qr(qr_BROKEN_LIFTSWIM))
10089+
drop_liftwpn();
1008710090
handle_passive_buttons();
1008810091
if(liftclk)
1008910092
{

0 commit comments

Comments
 (0)