Just on the off chance that there are some C++ experts here.
Would anyone be able to suggest a course of action to resolve the following error?
int CNWNXChat::SendMsg(int nChannel, int oSender, char * sMessage, int nRecipientID){
CNWSMessage * mess = (*NWN_AppManager)->app_server->GetNWSMessage();
CExoString * msg = (CExoString*)mem.nwnx_malloc(sizeof(CExoString));
msg->CExoStringCpy(sMessage);
int ret = mess->SendServerToPlayerChatMessage(nChannel, oSender, *msg, nRecipientID);
if (msg->text)
mem.nwnx_free(msg->text);
mem.nwnx_free(msg);
return ret;
}
When debugging, I can see the execution gets into the line
int ret = mess->SendServerToPlayerChatMessage(nChannel, oSender, *msg, nRecipientID);
Which looks like this:
int CNWSMessage_s::SendServerToPlayerChatMessage(uint8_t Channel, nwn_objid_t Sender, CExoString Msg, uint32_t player_id) {
return CNWSMessage__SendServerToPlayerChatMessage(this, Channel, Sender, Msg, player_id);
}
When it steps past the return line - it errors out with the following error
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
The hooked method is declared as:
int (__thiscall *CNWSMessage__SendServerToPlayerChatMessage)(CNWSMessage *pTHIS, uint8_t Channel, nwn_objid_t Sender, CExoString Msg, uint32_t player_id) = (int (__thiscall*)(CNWSMessage *pTHIS, uint8_t Channel, nwn_objid_t Sender, CExoString Msg, uint32_t player_id))0x0043CA00;
Yes - this is 1.69, not EE