News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

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

Started by z9999, December 13, 2008, 07:48:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999

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

Result:
Crash


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




z9999

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

dataobj\einstellungen.cc:349-

// restore AI state
for(  int i=0;  i<15;  i++  ) {
file->rdwr_bool( automaten[i], "" );
file->rdwr_byte( spieler_type[i], "" );
file->rdwr_str( password[i], "" );
}




15 ?
MAX_PLAYER_COUNT ?

simworld.cc:2113-

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 ?

z9999

#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.

prissi

AI states should save correctly. Will look into this too.

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

z9999

#4
Quote from: prissi on December 14, 2008, 03:45:01 PM
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.

z9999

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


z9999

#7
Quote from: Frank on December 15, 2008, 02:46:54 PM
del the simworld.cfg in [user]/simutrans

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



solved in r2170. thank you.