Bonehard
06-10-2014, 01:23 AM
Hello all,
first i'am not sure where to post this under wich dev section.
So feel free to move to the correct section. :)
I'am working on some code and have find a strange bug and not sure where this comes from.
I have add some code to the Client::OPMemorizeSpell function.
// Custom - Used for disabling scribes more than given number
if (disableScribe)
{
// Count scribed spells
int iScribed = 0;
for (int i = 0; i < MAX_PP_SPELLBOOK; i++)
{
if (m_pp.spell_book[i] != 0xFFFFFFFF)
iScribed++;
}
// check if we reached the maximum client can scribe spells
if (iScribed >= numMaxScribeSpells)
{
Message(13, "Maximum spells scribed. Please unscripe some spells.");
return;
}
}
The code is very simple it checks just if the user can scribe a spell or max number is reached. For example i disable scribing after 10 spells so that the user will get the message above.
The code works so far when a user tries to scribe a spell and reached the maximum scribe number he gets this message and the spells will not be scribed.
So far so good. :)
But on the client something strange happend.
The user get the info from server spell is not scribed but the gui is not responding anymore.
I can't click on npc's or door's.
Keys also don't work anymore so i cant open any windows like inventory.
I can open dialogs like inventory only over the menu.
Buttons stills works but it seems the gui is not responding anymore to hotkeys.
If i open one of the dialogs like inventory over the menu it shows up but it takes no input from mouse.
This happend to any menu i call over the menu.
I can click into the chat input window and still can type some commands.
So when i use the #zone command to leave the zone the gui seems to work like it should.
It only happend when i try to use the custom code i posted above.
Some more infos:
I compile under windows with visual studion 2013 in X64 mode.
The client iam testing at the moment is underfoot(steam).
Thanks in advance!!!
(Going to work now. Maybe i can respond later from work.)
first i'am not sure where to post this under wich dev section.
So feel free to move to the correct section. :)
I'am working on some code and have find a strange bug and not sure where this comes from.
I have add some code to the Client::OPMemorizeSpell function.
// Custom - Used for disabling scribes more than given number
if (disableScribe)
{
// Count scribed spells
int iScribed = 0;
for (int i = 0; i < MAX_PP_SPELLBOOK; i++)
{
if (m_pp.spell_book[i] != 0xFFFFFFFF)
iScribed++;
}
// check if we reached the maximum client can scribe spells
if (iScribed >= numMaxScribeSpells)
{
Message(13, "Maximum spells scribed. Please unscripe some spells.");
return;
}
}
The code is very simple it checks just if the user can scribe a spell or max number is reached. For example i disable scribing after 10 spells so that the user will get the message above.
The code works so far when a user tries to scribe a spell and reached the maximum scribe number he gets this message and the spells will not be scribed.
So far so good. :)
But on the client something strange happend.
The user get the info from server spell is not scribed but the gui is not responding anymore.
I can't click on npc's or door's.
Keys also don't work anymore so i cant open any windows like inventory.
I can open dialogs like inventory only over the menu.
Buttons stills works but it seems the gui is not responding anymore to hotkeys.
If i open one of the dialogs like inventory over the menu it shows up but it takes no input from mouse.
This happend to any menu i call over the menu.
I can click into the chat input window and still can type some commands.
So when i use the #zone command to leave the zone the gui seems to work like it should.
It only happend when i try to use the custom code i posted above.
Some more infos:
I compile under windows with visual studion 2013 in X64 mode.
The client iam testing at the moment is underfoot(steam).
Thanks in advance!!!
(Going to work now. Maybe i can respond later from work.)