• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

tfs 1.4.2 basespeed bug

edddaaan

New Member
Joined
May 28, 2014
Messages
5
Reaction score
2
As the title says i have a problem with base speed in tfs 1.4.2 i have done changes in player.h and protocolgame.cpp

changes in player.h
Lua:
static constexpr int32_t PLAYER_MAX_SPEED = 3000;
static constexpr int32_t PLAYER_MIN_SPEED = 10;
Lua:
void updateBaseSpeed() {
            if (!hasFlag(PlayerFlag_SetMaxSpeed)) {
                baseSpeed = vocation->getBaseSpeed();
            } else {
                baseSpeed = PLAYER_MAX_SPEED;
            }
        }
i belive this part is correct, i want all levels have the same speed


changes in protocolgame.cpp
Lua:
msg.add<uint16_t>(player->getBaseSpeed()/1);
Lua:
void ProtocolGame::sendChangeSpeed(const Creature* creature, uint32_t speed)
{
    NetworkMessage msg;
    msg.addByte(0x8F);
    msg.add<uint32_t>(creature->getID());
    msg.add<uint16_t>(creature->getBaseSpeed() / 1);
    msg.add<uint16_t>(speed / 1);
    writeToOutputBuffer(msg);
}
This part is what have me confused because i found another tread where they say change from "getBaseSpeed() / 2 " to "getBaseSpeed() / 1 "in protocolgame but i find it on multiple spots and it returns negative speed if i leave it as is atm.

Skärmbild 2023-07-07 132900.png
Post automatically merged:

Code:
msg.add<uint16_t>(creature->getStepSpeed() / 1);
When i added this the speed got set correctly but i got lagwalking that way so i reverted to /2 everywhere and went with 2x values in vocations.xml and increased PLAYER_MAX_SPEED to be twice as high i want maxspeed to be
 
Last edited:
Back
Top