forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

weapons.h breaks weapons.xml

Open uberlerd opened this issue 3 years ago • 1 comments

I'm running TFS 1.5 (latest) and after the update this week it appears that the behavior in weapons.xml has switched from explicitly allowing vocations to use weaponry to disallowing the specified vocation(s) from using that weaponry.

For example, the wand of vortex allows sorcerers to use it per the weapons.xml, however the sorcerer is now the only vocation that cannot use this wand.

<wand id="2190" level="7" mana="2" min="8" max="18" type="energy"> <!-- Wand of Vortex -->
    <vocation name="Sorcerer" />
</wand>

Expected behavior

The vocation name(s) listed per item in weapons.xml explicitly allow only those specified vocation(s) to use it.

Actual behavior

The vocation name(s) not listed per item in weapons.xml explicitly allow only those not specified vocation(s) to use it.

###Confirmation I confirmed this bug by changing the allowed vocation to Knight, and then knight was the only vocation incapable of using the wand of vortex.

###Resolution Changing the following line in weapons.h from "!=" return !vocationWeaponSet.empty() && vocationWeaponSet.find(vocationId) != vocationWeaponSet.end();

to "==" return !vocationWeaponSet.empty() && vocationWeaponSet.find(vocationId) == vocationWeaponSet.end();

and building the docker from the modified sources resolves this issue.

uberlerd avatar Dec 11 '22 16:12 uberlerd

https://github.com/otland/forgottenserver/pull/4262

EPuncker avatar Dec 12 '22 08:12 EPuncker