• 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!

C++ 1.x+ Correct way to make U32 mana and health

kaincer

Member
Joined
Jun 28, 2010
Messages
44
Reaction score
5
Src= TFS-1.5-Downgrades/src/protocolgame.cpp at 8.0 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/8.0/src/protocolgame.cpp#L3085)
1690705626595.png
I'm supposed to change 16 -> 32 but it doesn't work xd

Lua:
msg.add<uint32_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint32_t>::max()));
    msg.add<uint32_t>(std::min<int32_t>(player->getMaxHealth(), std::numeric_limits<uint32_t>::max()));


    msg.add<uint32_t>(std::min<int32_t>(player->getMana(), std::numeric_limits<uint32_t>::max()));
    msg.add<uint32_t>(std::min<int32_t>(player->getMaxMana(), std::numeric_limits<uint32_t>::max()));

and activate in feature.lua
Code:
g_game.enableFeature(GameDoubleHealth)
ERROR:
Code:
ERROR: ProtocolGame parse message exception (257 bytes, 0 unread, last opcode is 0x68 (104), prev opcode is 0x6d (109)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong.
ProtocolGame parse message exception (4596 bytes, 4556 unread, last opcode is 0x5c (92), prev opcode is 0xa0 (160)
ProtocolGame parse message exception (279 bytes, 0 unread, last opcode is 0x68 (104), prev opcode is 0x6d (109)
 
Back
Top