OpenTTD

Tasklist

FS#1150 - failed assertion when switching player to AI player

Attached to Project: OpenTTD
Opened by Mall Monkey (mallmonkey) - Wednesday, 22 August 2007, 12:59 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 24 August 2007, 22:23 GMT
Type Bug
Category Core
Status Closed
Assigned To Bjarni (Bjarni)
Operating System Mac OS X
Severity Low
Priority Normal
Reported Version trunk
Due in Version 0.6.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Tested in r10955. I've also tested 0.5.2 and that doesn't seem to have this bug.

When playing a game with an AI player, the game crashes if "Playing as player: X" (in the cheat menu) is used to change to an AI player. This happens with both the "new AI (alpha)" and the old AI. As soon as you click on the little ">" button before the 'Playing as player: 0' text it asserts:

dbg: [sprite] Tried to load real sprite #846 as a non sprite. Probable cause: NewGRF interference
/compile_farm/openttd/nightly/compile_dir/src/player.h:241: failed assertion `IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players))'
Abort trap

There are no custom NewGRFs loaded.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Friday, 31 August 2007, 19:49 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r11023.
Comment by Remko Bijker (Rubidium) - Wednesday, 22 August 2007, 19:18 GMT
It doesn't seem to trigger in my OpenTTD nightly, what about the savegame in which you have this?

Furthermore the debug message about the real sprite as non-sprite only happens when at least two NewGRFs are loaded. I therefor conclude that you are using some NewGRFs.
Comment by Mall Monkey (mallmonkey) - Wednesday, 22 August 2007, 19:58 GMT
I suspected you might conclude that, that's why I mentioned there are no custom NewGRFs loaded. Not by me anyway :-)
I've double checked, but even the 'NewGRF settings' windows shows no NewGRFs.

It's also not a specific game, when I start a new game, wait for an AI to join me and then change the player, it asserts every time. I've renamed my ~/Documents/OpenTTD folder to something else so I'd use the default config, but the problems stays.
Comment by Mall Monkey (mallmonkey) - Wednesday, 22 August 2007, 20:10 GMT
I've done another test: I've tried another Mac (with r10438 and r10963), and both builds behave exactly as described above. I've also tried the Windows build of r10963, and that doesn't crash.
Comment by Remko Bijker (Rubidium) - Wednesday, 22 August 2007, 20:42 GMT
Hmm, that starts to sound like an endianness issue. Are you using a PowerPC Mac (G4/G5 or older)?
Comment by Mall Monkey (mallmonkey) - Wednesday, 22 August 2007, 20:44 GMT
PowerPC G5 on both Macs. Unfortunatly I don't have my Macbook here, so I can't test with an Intel build.
Comment by Mall Monkey (mallmonkey) - Friday, 24 August 2007, 05:10 GMT
Mac OS X on Intel doesn't crash either.
Comment by Remko Bijker (Rubidium) - Friday, 31 August 2007, 13:49 GMT
Can you check whether the attached patch fixes your problem?
Comment by Mall Monkey (mallmonkey) - Friday, 31 August 2007, 17:58 GMT
That patch indeed fixes the problem.

Loading...