Friends & Foes (Fabric/Quilt) (Copper Golem,Glare,Crab,Moobloom,Iceologer,Rascal,Tuff Golem,Wildfire,Illusioner)

Raid Mixin Misinterpreted Logic

GToidZ opened this issue ยท 3 comments

commented

This code checks if the raider is an instance of Iceologer or Illusioner and determines if the entries in config are false or not.
However, it is checking for all those entries to be false.

Per the && operator in each inner conditionals.

if (
(
raider instanceof IllusionerEntity
&& FriendsAndFoes.getConfig().enableIllusioner == false
&& FriendsAndFoes.getConfig().enableIllusionerInRaids == false
) || (
raider instanceof IceologerEntity
&& FriendsAndFoes.getConfig().enableIceologer == false
&& FriendsAndFoes.getConfig().enableIceologerInRaids == false
)
) {
ci.cancel();
}

I think the intended behavior should be checking whether any config entry is false.
Below is what I think it is intended.

if (
        raider instanceof IllusionerEntity 
        && (
                FriendsAndFoes.getConfig().enableIllusioner == false ||
                FriendsAndFoes.getConfig().enableIllusionerInRaids == false
        )
)
commented

Hello, you are right, that is for sure not intended, i will fix this with the next release (1.5.6).
Also you are probably the first person going through the code and reporting some bad behaviour, so thank you for this :).

commented

No problem, I was just suspecting after making a raid farm and tweaking the mod's config, haha.
More importantly, cheers to you for making this amazing mod! ๐ŸŽ‰

commented

I am sorry, that it is taking this long, my scope for the update is pretty huge opposite to what i had in my mind initially.