lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I don't really use these preprocessor macros (we don't need to use them). The problem still lies on the stack that is changed when calling the function from Lua.
The only thing that Npc::sendGetNumber does is sending a packet to the client with these variables. They are not stored and such.

void Npc::sendGetNumber(int32_t def, int32_t min, int32_t max) {
    PacketCreator packet = npcPacket(NpcDialogs::GetNumber);
    packet.add<int32_t>(def);
    packet.add<int32_t>(min);
    packet.add<int32_t>(max);
    player->getSession()->send(packet);
}


> Date: Sun, 30 May 2010 11:29:17 +0100
> Subject: Re: Lua and C++ (stack)
> From: lua@corsix.org
> To: lua@bazar2.conectiva.com.br
>
> On Sun, May 30, 2010 at 11:18 AM, Erwin Oegema
> <blablaechthema@hotmail.com> wrote:
> > I guess it does :p It might have changed, but why would it work in Debug
> > mode and not in Release mode?
>
> At a guess, I'd say because getNpc depends upon the value of an
> uninitialised variable (whose values are different in Debug mode to
> Release mode; they're generally 0 in release mode, whereas they're
> 0xABABABAB or something similar in Debug mode). If not that, then
> perhaps due to the differences in which preprocessor macros are
> defined in Debug mode versus Release mode (e.g. if any of your code
> has "#ifdef NDEBUG", or calls assert(f()) where f() has side-effects,
> etc.).


Tijd voor een nieuwe telefoon? Bekijk de mogelijkheden van een Windows Phone!