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

Healling items stop working after logout - CLOSED

Vesgo

Member
Joined
Dec 4, 2009
Messages
356
Solutions
1
Reaction score
15
Location
Brasil
Im using TFs 0.4 rev 3777. I noticed that if a player is using a soft boots (or any item that heals mana ou hp) logs out, when he comes back the item is still getting consumed (soft boots or rings) but does not heal anymore. He needs to wear it off and on again to get it working.

Any hints?
 
protocolgame.cpp

after the includes:
Code:
#include "movement.h"

after the externs:
Code:
extern MoveEvent* g_moveEvents;

find bool ProtocolGame::logout(bool displayEffect, bool forceLogout)
under:
Code:
    if(Connection_ptr connection = getConnection())
        connection->close();
put:
Code:
    slots_t castSlot;
    for (int8_t slot = CONST_SLOT_FIRST; slot < CONST_SLOT_LAST; ++slot) {
        castSlot = static_cast<slots_t>(slot);
        Item* item = player->__getThing(castSlot);
        if (item) {
           g_moveEvents->onPlayerDeEquip(player, item, castSlot, true);
        }
    }
and recompile
 
Code:
../protocolgame.cpp: In member function 'bool ProtocolGame::logout(bool, bool)':
../protocolgame.cpp:351: error: 'CONST_SLOT_FIRST' was not declared in this scope
../protocolgame.cpp:351: error: 'CONST_SLOT_LAST' was not declared in this scope

../protocolgame.cpp:353: error: invalid conversion from 'Thing*' to 'Item*'
../protocolgame.cpp:353: error: cannot convert from base 'Thing' to derived type 'Item' via virtual base 'Thing'
../protocolgame.cpp:355: error: 'class MoveEvent' has no member named 'onPlayerDeEquip'

make.exe: *** [obj//protocolgame.o] Error 1

Execution terminated

Sry, did not work.
Any advices?
 
idk i hate 0.4
i have it working fine for 1.2
Code:
    slots_t castSlot;
    for (int8_t slot = SLOT_FIRST; slot < SLOT_DEPOT; ++slot) {
        castSlot = static_cast<slots_t>(slot);
        Thing* thing = player->__getThing(castSlot);
        if (thing) {
           g_moveEvents->onPlayerDeEquip(player, thing, castSlot, true);
        }
    }
try this?
make sure to include creature.h
 
Code:
./protocolgame.cpp: In member function 'bool ProtocolGame::logout(bool, bool)':
../protocolgame.cpp:356: error: 'class MoveEvent' has no member named 'onPlayerDeEquip'

make.exe: *** [obj//protocolgame.o] Error 1

Execution terminated

Ty for you help, but got this now!
I already included creature.h and movement.h
 
I just managed a way to test the sources, and they are working fine, i must have edited some sort of lua shi* and can solve it right now. But ty, the problem is not C++, it is lua for sure, i will dig after it now.
 
Back
Top