Free arm block and leg blocks without martial arts and skills

Started a new game, with tiger style (no blocks) and 0 melee and unarmed skill, but i’m still doing arm and leg blocks when fighting zombies

Likely a check not happening. Thanks for reporting.

I’ve found this with unarmed combat in general, including characters that are using no unarmed style at all, like those who haven’t even learned Brawling yet.

Very rusty programming, but i might have found the bug? game checks if unarmed skill is higher than the integer ma.arm_block or ma.leg_block, but the value of arm_block and leg_block is always -1. This is from src/martialarts.cpp

martialart::martialart()
{
leg_block = -1;
arm_block = -1;
}

ma.leg_block = jo.get_int(“leg_block”, -1);
ma.arm_block = jo.get_int(“arm_block”, -1);

if( unarmed_skill >= ma.arm_block ) {
return true;

OK did a little more testing, if character has NO martial arts with with blocking, character will always know arm and leg block, but if character has style with arm block, or arm+leg block, character will only use those blocks when unarmed skill meets the requirement.

I believe it’s because in martialarts.json styles without block (or no style) doesn’t give a value to arm_block and leg_block therefore they default to the -1 which will always make the check fuction return true

(or is -1 a special number or something?)

anyways the suggested fix is to assign a large arm_block and leg_block value to all the martial arts styles (and no style) in martialarts.json , like 100 or so

OK submitted a pull request on git

Was supposed to be a special number, but probably wasn’t working. Thanks for reporting & PRing, though I’d ask that you check your PR, as it had a few formatting issues when I last looked at it.