[fixed] recruiting preference for Youth academy is'nt saved

Here you can... report bugs. Open a new thread for each bug, please.
Post Reply
gunnar
Site Admin
Posts: 233
Joined: Wed Oct 19, 2005 11:13 am
Contact:

[fixed] recruiting preference for Youth academy is'nt saved

Post by gunnar »

The recruiting preference for Youth academy is not saved. If you apply the following patch it will. It doesn't break old savegames.

Code: Select all

Index: trunk/bygfoot2-unstable/src/xml_loadsave_users.c
===================================================================
--- trunk/bygfoot2-unstable/src/xml_loadsave_users.c    (revision 1017)
+++ trunk/bygfoot2-unstable/src/xml_loadsave_users.c    (working copy)
@@ -72,6 +72,7 @@
     TAG_USER_BET_WAGER,
     TAG_USER_BET_OUTCOME,
     TAG_USER_BET_FIX_ID,
+    TAG_USER_YA_PREFERENCE,
     TAG_END
 };

@@ -178,6 +179,7 @@
            tag == TAG_USER_YA_AV_COACH ||
            tag == TAG_USER_YA_AV_PERCENTAGE ||
            tag == TAG_USER_YA_COUNTER ||
+            tag == TAG_USER_YA_PREFERENCE ||
            tag == TAG_USER_BET0 ||
            tag == TAG_USER_BET1)
     {
@@ -319,6 +321,8 @@
        new_bet.outcome = int_value;
     else if(state == TAG_USER_BET_FIX_ID)
        new_bet.fix_id = int_value;
+    else if(state == TAG_USER_YA_PREFERENCE)
+        new_user.youth_academy.pos_pref = int_value;
     else if(state >= TAG_START_PLAYERS && state <= TAG_END_PLAYERS)
        xml_loadsave_players_text(buf);
 }
@@ -426,7 +430,7 @@
        xml_write_float(fil, usr(i).youth_academy.av_percentage,
                        TAG_USER_YA_AV_PERCENTAGE, I1);
        xml_write_float(fil, usr(i).youth_academy.counter_youth, TAG_USER_YA_COUNTER, I1);
-
+        xml_write_int(fil, usr(i).youth_academy.pos_pref, TAG_USER_YA_PREFERENCE, I1);
        xml_loadsave_players_write(fil, usr(i).youth_academy.players);

        fprintf(fil, "</_%d>\n", TAG_USER);
Post Reply