forgottenserver
forgottenserver copied to clipboard
[Bug]: NPCs custom speed attribute is ignored
By submitting this bug issue, you agree to the following.
- [X] This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
- [X] This issue is reproducible without changes to the C++ code in this repository
- [X] This bug has not been resolved in master branch
- [X] There is no existing issue for this bug already
Does this bug crash tfs?
no
Server Version
1.7 (Master)
Operation System
Windows
OS Description
10.0.19045.4529
Bug description
Setting "speed" attribute to NPC in XML has no effect in game
Possible Pull Requests which are to blame
- [ ] https://github.com/otland/forgottenserver/pull/4671
- [ ] https://github.com/otland/forgottenserver/pull/4724
- [ ] https://github.com/otland/forgottenserver/pull/4741
- [ ] https://github.com/otland/forgottenserver/pull/4747
Steps to reproduce
- Modify some NPC's speed attribute
- NPC speed is Creatures default: 220 https://github.com/otland/forgottenserver/blob/48352f6e07f93aca4182965866a3ec0c7cd08aed/src/creature.h#L398
Code to reproduce the issue:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Riona" script="default.lua" walkinterval="2000" floorchange="0" speed="10">
<health now="100" max="100" />
<look type="138" head="57" body="59" legs="40" feet="76" addons="0" />
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="backpack,1988,20;pick,2553,10;shovel,2554,20;rope,2120,50" />
</parameters>
</npc>
Actual Behavior
Even though NpcType' baseSpeed is loaded from XML it has no effect on getSpeed()/getBaseSpeed()/getStepSpeed()
Expected Behavior
speed attribute is respected
Backtrace
No response