Feature #598 » 0080-savegame-Save-ACTION_NONE-as-1.patch
| server/savegame/savecompat.c | ||
|---|---|---|
|           } | ||
|           if (!found) { | ||
|             secfile_insert_int(loading->file, ACTION_NONE, "player%d.u%d.action", | ||
|             secfile_insert_int(loading->file, -1, "player%d.u%d.action", | ||
|                                plrno, unro); | ||
|           } | ||
|         } | ||
| ... | ... | |
|           } | ||
|           if (!found) { | ||
|             secfile_insert_int(loading->file, ACTION_NONE, "player%d.u%d.action", | ||
|             secfile_insert_int(loading->file, -1, "player%d.u%d.action", | ||
|                                plrno, unro); | ||
|           } | ||
|         } | ||
| server/savegame/savegame3.c | ||
|---|---|---|
|         order->dir = char2dir(rally_dirs[i]); | ||
|         order->activity = char2activity(rally_activities[i]); | ||
|         unconverted = secfile_lookup_int_default(loading->file, ACTION_NONE, | ||
|         unconverted = secfile_lookup_int_default(loading->file, -1, | ||
|                                                  "%s.rally_point_action_vec,%d", | ||
|                                                  citystr, i); | ||
|         if (unconverted >= 0 && unconverted < loading->action.size) { | ||
|         if (unconverted == -1) { | ||
|           order->action = ACTION_NONE; | ||
|         } else if (unconverted >= 0 && unconverted < loading->action.size) { | ||
|           /* Look up what action id the unconverted number represents. */ | ||
|           order->action = loading->action.order[unconverted]; | ||
|         } else { | ||
| ... | ... | |
|         case ORDER_LAST: | ||
|           break; | ||
|         } | ||
|         if (actions[j] == ACTION_NONE) { | ||
|           actions[j] = -1; | ||
|         } | ||
|       } | ||
|       orders[len] = dirs[len] = activities[len] = '\0'; | ||
| ... | ... | |
|   sg_warn_ret_val(secfile_lookup_int(loading->file, &ei, | ||
|                                      "%s.action", unitstr), FALSE, | ||
|                   "%s", secfile_error()); | ||
|   if (ei == ACTION_NONE) { | ||
|   if (ei == -1) { | ||
|     action = ACTION_NONE; | ||
|   } else { | ||
|     action = loading->action.order[ei]; | ||
| ... | ... | |
|                                                  "%s.action_vec,%d", | ||
|                                                  unitstr, j); | ||
|         if (unconverted >= 0 && unconverted < loading->action.size) { | ||
|         if (unconverted == -1) { | ||
|           order->action = ACTION_NONE; | ||
|         } else if (unconverted >= 0 && unconverted < loading->action.size) { | ||
|           /* Look up what action id the unconverted number represents. */ | ||
|           order->action = loading->action.order[unconverted]; | ||
|         } else { | ||
| ... | ... | |
|     secfile_insert_int(saving->file, punit->activity, "%s.activity", buf); | ||
|     secfile_insert_int(saving->file, punit->activity_count, | ||
|                        "%s.activity_count", buf); | ||
|     secfile_insert_int(saving->file, punit->action, "%s.action", buf); | ||
|     if (punit->action == ACTION_NONE) { | ||
|       secfile_insert_int(saving->file, -1, "%s.action", buf); | ||
|     } else { | ||
|       secfile_insert_int(saving->file, punit->action, "%s.action", buf); | ||
|     } | ||
|     if (punit->activity_target == NULL) { | ||
|       secfile_insert_int(saving->file, -1, "%s.activity_tgt", buf); | ||
|     } else { | ||
| ... | ... | |
|         case ORDER_LAST: | ||
|           break; | ||
|         } | ||
|         if (action_buf[j] == ACTION_NONE) { | ||
|           action_buf[j] = -1; | ||
|         } | ||
|       } | ||
|       orders_buf[len] = dir_buf[len] = act_buf[len] = '\0'; | ||