Skip to content

Commit

Permalink
manage default value for old save game
Browse files Browse the repository at this point in the history
  • Loading branch information
dvincent56 committed Apr 16, 2024
1 parent 06b4b0b commit 097bd18
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/building/construction_building.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ static void add_to_map(int type, building *b, int size, int orientation, int wat
building_monument_set_phase(b, MONUMENT_START);
if (type == BUILDING_GRAND_TEMPLE_MARS) {
b->accepted_goods[RESOURCE_WEAPONS] = 1;
b->accepted_goods[RESOURCE_NONE] = 1;
}
break;
case BUILDING_MESS_HALL:
Expand Down Expand Up @@ -300,7 +301,8 @@ static void add_to_map(int type, building *b, int size, int orientation, int wat
add_building(b);
break;
case BUILDING_BARRACKS:
b->accepted_goods[RESOURCE_WEAPONS] = 1;
b->accepted_goods[RESOURCE_WEAPONS] = 1;
b->accepted_goods[RESOURCE_NONE] = 1;
add_building(b);
break;

Expand Down
8 changes: 8 additions & 0 deletions src/building/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,14 @@ void building_state_load_from_buffer(buffer *buf, building *b, int building_buf_
b->figure_id2 = 0;
}

// Old save barracks and temple of mars should accept weapons by default
if (b->type == BUILDING_BARRACKS || b->type == BUILDING_GRAND_TEMPLE_MARS) {
if (!b->accepted_goods[RESOURCE_NONE]) {
b->accepted_goods[RESOURCE_NONE] = 1; // set RESOURCE_NONE to 1 to mark this as a new save compatibility
b->accepted_goods[RESOURCE_WEAPONS] = 1;
}
}

// The following code should only be executed if the savegame includes building information that is not
// supported on this specific version of Augustus. The extra bytes in the buffer must be skipped in order
// to prevent reading bogus data for the next building
Expand Down
4 changes: 2 additions & 2 deletions src/translation/english.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,8 +1393,8 @@ static translation_string all_strings[] = {
{TR_WINDOW_ADVISOR_MILITARY_INFANTRY, "Infantrymen"},
{TR_TOOLTIP_BUTTON_ROADBLOCK_ORDER_ACCEPT_ALL, "Accept all walkers"},
{TR_TOOLTIP_BUTTON_ROADBLOCK_ORDER_REJECT_ALL, "Refuse all walkers"},
{TR_TOOLTIP_BUTTON_STORAGE_ORDER_ACCEPT_ALL, "Accept all goods" },
{TR_TOOLTIP_BUTTON_STORAGE_ORDER_REJECT_ALL, "Refuse all goods" },
{TR_TOOLTIP_BUTTON_STORAGE_ORDER_ACCEPT_ALL, "Accept all goods"},
{TR_TOOLTIP_BUTTON_STORAGE_ORDER_REJECT_ALL, "Refuse all goods"},
{TR_FIGURE_TYPE_BEGGAR, "Beggar"},
{TR_BUILDING_ARMOURY, "Armory" },
{TR_BUILDING_ARMOURY_NO_EMPLOYEES, "Without access to employees, the armory cannot deliver weapons to our soldiers. May Mars protect us, because the unarmed legions certainly will not!"},
Expand Down
2 changes: 2 additions & 0 deletions src/translation/french.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,8 @@ static translation_string all_strings[] = {
{TR_WINDOW_ADVISOR_MILITARY_INFANTRY, "Fantassins"},
{TR_TOOLTIP_BUTTON_ROADBLOCK_ORDER_ACCEPT_ALL, "Autoriser tous les marcheurs"},
{TR_TOOLTIP_BUTTON_ROADBLOCK_ORDER_REJECT_ALL, "Refuser tous les marcheurs"},
{TR_TOOLTIP_BUTTON_STORAGE_ORDER_ACCEPT_ALL, "Autoriser toutes les marchandises"},
{TR_TOOLTIP_BUTTON_STORAGE_ORDER_REJECT_ALL, "Refuser toutes les marchandises"},
{TR_FIGURE_TYPE_BEGGAR, "Mendiant"},
{TR_BUILDING_ARMOURY, "Armurerie" },
{TR_BUILDING_ARMOURY_NO_EMPLOYEES, "L'armurerie n'ayant pas de main-d'œuvre, aucune arme n'est livrée aux soldats. Puisse Mars nous protéger à la place de nos légions !"},
Expand Down

0 comments on commit 097bd18

Please sign in to comment.