1.9.0 crash

Here you can... report bugs. Open a new thread for each bug, please.
Post Reply
Stepan

1.9.0 crash

Post by Stepan »

On http://www.srnet.cz/~stepan/temp/.bygfo ... save02.zip there is a save from Bygfoot 1.9.0 which after few weeks "crashes" (it is not segfault, it just vanishes) with this message:

** (bygfoot:5573): WARNING **: player_of_id_team: didn't find player with id 491 of team York
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Post by MarkC »

Győző, it looks like players aren't removed from the transfer list when their contract expires.

I'm not confident enough with the code yet to make the change myself. I'll see if what you do matches what I'd have done, and if so, I'll be happier in future to fix stuff like this :)

Thanks for reporting.

Mark
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Post by gyboth »

MarkC wrote:Győző, it looks like players aren't removed from the transfer list when their contract expires.
yes, seems very much so. i had a lot of trouble reproducing :-P 1. my current local version is incompatible with the above save file 2. after i loaded it with the release version i set debug to 100, forgetting that contracts don't expire then :roll: then i wondered why the crash didn't occur.
I'm not confident enough with the code yet to make the change myself. I'll see if what you do matches what I'd have done, and if so, I'll be happier in future to fix stuff like this :)
my change is: include transfer.h in player.c, add

Code: Select all

transfer_remove_player_ptr(player_of_idx_team(tm, idx));
to the player_remove_contract function. Makefile.am has to be updated, of course.

if your solution is the same (or better ;-)), you're welcome to commit it to cvs and i'll be glad to have a companion in bug-fixing in the future :-)

and stepan, in order to continue your game you just have to remove the player from the transfer list before his contract expires.

and mark, i guess the long ö's aren't really easily accessible on your keyboard. you can write gyozo or gyözö, no problem ;-)

gyözö
Press any key to continue or any other key to quit.
Stepan

Post by Stepan »

gyboth wrote: and stepan, in order to continue your game you just have to remove the player from the transfer list before his contract expires.
Thanks, game fixed it itself by buying that player. So I was not only able to continue the game, but also earned money :-)
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Post by MarkC »

my change is: include transfer.h in player.c, add

Code: Select all

transfer_remove_player_ptr(player_of_idx_team(tm, idx));
to the player_remove_contract function. Makefile.am has to be updated, of course.
Right, yes, I would have done this, but now I've had second thoughts. The bug also occurs if you fire a player that's on the transfer list. I guess it would also happen when a player retires due to injury.

It's either a case of adding transfer_remove_player_ptr() to each of these places as well, or grouping the two calls into a general function called something like "player_remove_from_game" and using that instead.

After all, we might find other things that need clearing up when a player disappears, and it'd be messy to have to repeat a bunch of calls all over the place.

I don't want to mess with too many files though, and I don't have any more time tonight anyway.
and mark, i guess the long ö's aren't really easily accessible on your keyboard. you can write gyozo or gyözö, no problem
:lol: I just wondered if you'd say anything!
Actually both characters are equally inaccessible at the moment (ancient keyboard) so it made no difference, and I'm too much of a purist to type gyozo :)

Mark
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Post by gyboth »

MarkC wrote:Right, yes, I would have done this, but now I've had second thoughts. The bug also occurs if you fire a player that's on the transfer list. I guess it would also happen when a player retires due to injury.
how neglectful of me not to think of those cases -- indeed, not to have thought of them in the first place, just removing players willy-nilly :oops:
It's either a case of adding transfer_remove_player_ptr() to each of these places as well, or grouping the two calls into a general function called something like "player_remove_from_game" and using that instead.
yes. after browsing a bit through the code i'd say that all the relevant cases are covered by the player_remove_from_team function, so if we just add that transfer_remove func to this function, things should be ok. (i just cvs-ed, in fact.)
Actually both characters are equally inaccessible at the moment (ancient keyboard) so it made no difference, and I'm too much of a purist to type gyozo :)
hehe, your choice. do you know how to pronounce it? i mean, writing it correctly is a piece of cake compared to the pronounciation ;-)

gyözö
Press any key to continue or any other key to quit.
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Post by MarkC »

how neglectful of me not to think of those cases -- indeed, not to have thought of them in the first place, just removing players willy-nilly :oops:
Easily done, worry not :)
yes. after browsing a bit through the code i'd say that all the relevant cases are covered by the player_remove_from_team function, so if we just add that transfer_remove func to this function, things should be ok. (i just cvs-ed, in fact.)
Ah, but this introduces a bug. Now, when you sell a player, both transfer_remove_player_ptr and transfer_remove_player get called, so two players get taken off the list.
I've committed a fix to cvs (just removed the call to transfer_remove_player in misc2_callback_func.c)
hehe, your choice. do you know how to pronounce it? i mean, writing it correctly is a piece of cake compared to the pronounciation ;-)
Probably not :) I believe the 'gy' is kind of like a soft 'j' but further back in the mouth, nearer a g. I'd just pronounce the ő the same as the German ö, but I imagine they're not quite the same.
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Post by gyboth »

MarkC wrote:Ah, but this introduces a bug. Now, when you sell a player, both transfer_remove_player_ptr and transfer_remove_player get called, so two players get taken off the list.
I've committed a fix to cvs (just removed the call to transfer_remove_player in misc2_callback_func.c)
great. hadn't thought of that.
Probably not :) I believe the 'gy' is kind of like a soft 'j' but further back in the mouth, nearer a g.
sounds like the best an englishman can manage ;-)
I'd just pronounce the ő the same as the German ö, but I imagine they're not quite the same.
they're pronounced long, which is why there are long bars (er.. bars?) on the ös. gyööözööö. and the 'z' is voiced (like you'd pronounce it anyway, i suppose) :-)

gyözö
Press any key to continue or any other key to quit.
Post Reply