11.08.2018, 22:27
You didn't really explain why it occurs, you just said that it occurs.
So for those who don't know, both D_LOGIN and D_CLICKEDPLAYER are equal to 0, which is why the code can't distinguish between the 2. There are 2 ways I can come up with to fix this.
Method 1:
Offset one enum with a given value.
This method is not futureproof when you add more elements to the first enum in the future, because you might forget to adjust the offset of the second enum.
Method 2:
Use a single enum with all dialogs in it and put the enum in a .inc file that you include in both scripts.
So for those who don't know, both D_LOGIN and D_CLICKEDPLAYER are equal to 0, which is why the code can't distinguish between the 2. There are 2 ways I can come up with to fix this.
Method 1:
Offset one enum with a given value.
Код:
enum { D_LOGIN, //Starts at 0 D_REGISTER } enum { D_CLICKEDPLAYER = 2 //Starts at 2 }
Method 2:
Use a single enum with all dialogs in it and put the enum in a .inc file that you include in both scripts.