Skip to content

Commit

Permalink
basecomputer.cpp, unit_generic.cpp: Fix a few Python module paths; al…
Browse files Browse the repository at this point in the history
…so fix a few more references to 8-sided armor
  • Loading branch information
stephengtuggy committed Jan 15, 2025
1 parent ce9c51f commit df25d52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions engine/src/cmd/basecomputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3943,7 +3943,7 @@ string buildUpgradeDescription(Cargo &item) {
const std::string key = item.GetName() + "__upgrades";
PyObject* args = PyTuple_Pack(1, PyUnicode_FromString(key.c_str()));
const std::string text = GetString("get_upgrade_info", "upgrade_view",
"python/base_computer/upgrade_view.py", args);
"upgrade_view.py", args);
return text;
}

Expand Down Expand Up @@ -4501,7 +4501,7 @@ bool BaseComputer::showPlayerInfo(const EventCommandId &command, Control *contro
PyObject* args = PyTuple_Pack(3, names_list.ptr(), relations_list.ptr(), kills_list.ptr());

const std::string text = GetString("get_player_info", "player_info",
"python/base_computer/player_info.py", args);
"player_info.py", args);

//Put this in the description.
StaticDisplay *desc = static_cast< StaticDisplay * > ( window()->findControlById("Description"));
Expand Down Expand Up @@ -4654,7 +4654,7 @@ void showUnitStats(Unit *playerUnit, string &text, int subunitlevel, int mode, C
if (!mode) {
std::map<std::string, std::string> ship_map = playerUnit->UnitToMap();
text += GetString("get_ship_description", "ship_view",
"python/base_computer/ship_view.py",
"ship_view.py",
ship_map);
}
if (mode && replacement_mode == 2 && playerUnit->getMass() != blankUnit->getMass())
Expand Down Expand Up @@ -4961,9 +4961,9 @@ void showUnitStats(Unit *playerUnit, string &text, int subunitlevel, int mode, C
" - Aft-port-low: #-c"
};

int armor_indices[8] = {2, 6, 0, 4, 3, 7, 1, 5};
int armor_indices[4] = {0, 1, 2, 3};

for (int i = 0; i < 8; i++) {
for (int i = 0; i < 4; ++i) {
PRETTY_ADDU(
substatcolor + armor_color_strings[i],
(mode && replacement_mode
Expand Down
8 changes: 4 additions & 4 deletions engine/src/cmd/unit_generic.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* unit_generic.cpp
*
* Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike contributors.
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
Expand All @@ -19,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/

// -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
Expand Down Expand Up @@ -2941,7 +2941,7 @@ bool Unit::UpAndDownGrade(const Unit *up,

if (!csv_cell_null_check || force_change_on_nothing
|| cell_has_recursive_data(upgrade_name, up->faction, "Armor_Front_Top_Right")) {
for (int i = 0; i < 8; i++) {
for (int i = 0; i < armor->number_of_facets; ++i) {
STDUPGRADE(armor->facets[i].health,
up->armor->facets[i].health,
templ->armor->facets[i].health, 0);
Expand Down Expand Up @@ -4682,4 +4682,4 @@ float Unit::energyData() const {
} else {
return energy.Percent();
}
}
}

0 comments on commit df25d52

Please sign in to comment.