Open GrantSP opened 10 years ago
The way to read that line is: "If a leader's Personality column is undefined (blank/null), define it as a Diplomat."
Everyone has a defined personality, and the code looks correct, so I think the problem is not in this block of code. It's probably somewhere else. Is Ashurbanipal's name misspelled anywhere? Did you change any code involving personalities? Do any other leaders produce this error?
I haven't touched any of this, or related code. I am sure this occurs with other leaders also. I wasn't keeping tabs on it, but from memory yes, other leaders have this happen.
I ask because this function is mainly used for IsMilitaristicLeader, which gets called so often any bugs there would have shown up in... wait
That part's disabled, and I'm not sure why I did it. I'm checking when the function was changed...
Hmm it appears I may have disabled it back when we didn't have personalities assigned to the new leaders yet. I think it's okay to re-enable it, and will try that. I doubt it will fix the problem you encountered (since the code was disabled) but might lead us to the source.
Every so often I check the logs of games that run perfectly and see this sort of ERROR listing:
MT_Initialize: ERROR Ashurbanipal has no personality
Clearly this isn't the case. The database shows ALL the leaders have defined personalities, so just what is this ERROR?
I can see in MT_Player.lua the function that handles this message state.
Why is this flagged as an error in the log? Does this mean every leader with a personality other than DIPLOMAT will force this error?