Skip to main content
Topic: [solved]r2161 - Crash when activate Player after than 6 (Read 4736 times) previous topic - next topic

[solved]r2161 - Crash when activate Player after than 6

How to reprodece:
1. Select one of the player after than 6
2. Push activate button.

Result:
Crash

Code: [Select]
sim.exe caused an Access Violation at location 0059f2bc in module sim.exe Reading from location 6048b7c6.

Registers:
eax=6048b7b8 ebx=6048b7b8 ecx=00000000 edx=00000000 esi=006d0074 edi=00730070
eip=0059f2bc esp=0023eb24 ebp=0023fa18 iopl=0         nv up ei pl zr ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000256

Call stack:
0059F2BC  sim.exe:0059F2BC  recode()  simgraph16.cc:699
...
for (n = 0; n < anz_images; n++) {
// tut jetzt on demand recode_img() fr jedes Bild einzeln
> images[n].recode_flags |= FLAG_NORMAL_RECODE;
images[n].player_flags = NEED_PLAYER_RECODE;
}
...

005A8C53  sim.exe:005A8C53  WinMain  simsys_w16.cc:756
...
GetWindowRect(GetDesktopWindow(), &MaxSize);

> simu_main(argc, argv);

#ifdef MULTI_THREAD
...

00401247  sim.exe:00401247
00401298  sim.exe:00401298
7C817067  kernel32.dll:7C817067  RegisterWaitForInputIdle



Re: r2161 - Crash when activate Player after than 6

Reply #1
Sorry, I didn't make a new topic.
Is these code right ?

dataobj\einstellungen.cc:349-
Code: [Select]
			// restore AI state
for(  int i=0;  i<15;  i++  ) {
file->rdwr_bool( automaten[i], "" );
file->rdwr_byte( spieler_type[i], "" );
file->rdwr_str( p****word[i], "" );
}



15 ?
MAX_PLAYER_COUNT ?

simworld.cc:2113-
Code: [Select]
		for(int x=0; x<MAX_PLAYER_COUNT-1; x++) {
if(spieler[x]) {
spieler[x]->age_messages(delta_t);
}
}


MAX_PLAYER_COUNT-1 ?
MAX_PLAYER_COUNT ?

Re: r2161 - Crash when activate Player after than 6

Reply #2
Tested in r2165.

1. Select "Manual(Human)"
2. Push activate button.

Still causes to crash. But when I select AI, it didn't crash.


BTW, AI states are not saved correctly yet ?
When I seave the game and reload it, player color, active states, money of AI  will be changed.

Re: r2161 - Crash when activate Player after than 6

Reply #3
AI states should save correctly. Will look into this too.

Human player should nto show activation, this is an error.

Re: r2161 - Crash when activate Player after than 6

Reply #4
Human player should nto show activation, this is an error.

Without activate, how can I change to that player ?
In current version, player_change button only appeares when the player is activated.

[edit]
Ahh.. when I activate no.8 AI player, simutrans crashed, too.

Re: r2161 - Crash when activate Player after than 6

Reply #5
Tested in r2167.

Still have many problems. They don't save correctrly.
- colors
- money
- vehicle (disappear)
- line (disappear)


How to reproduce:
1. Start simutrans
2. Open player list and acrivate player 12 as "Human".
3. Change to player 12
4. Build road, station depot
5. Buy vehicle, make new line and attach line
6. Start vehicle
7. Save game
8. Load the game


Re: r2161 - Crash when activate Player after than 6

Reply #7
del the simworld.cfg in [user]/simutrans

I don't have it both in user dir and program dir.


solved in r2170. thank you.