BUG onStartGame error

Joined
Jul 5, 2004
Messages
23,562
Location
Canberra, Australia
Hi, I am suddenly getting this error which is pointing to BUG code not my code.

Code:
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
TypeError: onGameStart() takes no arguments (1 given)

This has started when I added in a new mod with an onGameStart event. The other mod(s) with this event had no problem.

Just incase it helps I have included the python & config xml (locusts.7z) and the logs.
 
Does onGameStart() take a single argsList argument? If not, it must. Even events that have no parameters take an empty argsList list.

I checked the code, and all those onXXX() event handlers must add an argsList parameter. In fact, one of them is using argsList without declaring it.

Code:
def onEndPlayerTurn():
	'Called at the end of a players turn'
	iGameTurn, iPlayer = [B][COLOR="Red"]argsList[/COLOR][/B]    # naughty!!

to clarify, the above should be

Code:
def onEndPlayerTurn([B][COLOR="Red"]argsList[/COLOR][/B]):
	'Called at the end of a players turn'
	iGameTurn, iPlayer = argsList
 
Top Bottom