Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/game_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool Game_Actor::IsItemUsable(int item_id) const {
if (query_set->size() <= (unsigned)(query_idx)) {
return true;
}
return query_set->at(query_idx);
return (*query_set)[query_idx];
}

bool Game_Actor::IsSkillLearned(int skill_id) const {
Expand Down Expand Up @@ -1432,7 +1432,7 @@ PermanentStates Game_Actor::GetPermanentStates() const {
auto& states = item->state_set;
// Invalid states in armor already reported earlier in
// calls to AdjustEquipmentStates.
int num_states = std::min(states.size(), lcf::Data::states.size());
int num_states = std::min<int>(states.size(), lcf::Data::states.size());
for (int i = 0; i < num_states; ++i) {
if (states[i]) {
ps.Add(i + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/game_battlealgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ bool Game_BattleAlgorithm::Normal::Execute() {
} else {
auto& a1 = weapon1->attribute_set;
auto& a2 = weapon2->attribute_set;
std::vector<bool> attribute_set(std::max(a1.size(), a2.size()), false);
lcf::DBBitArray attribute_set(std::max(a1.size(), a2.size()), false);
for (size_t i = 0; i < attribute_set.size(); ++i) {
if (i < a1.size())
attribute_set[i] = attribute_set[i] | a1[i];
Expand Down
2 changes: 1 addition & 1 deletion src/game_battler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int Game_Battler::GetAttributeRate(int attribute_id, int rate) const {
return 0;
}

float Game_Battler::GetAttributeMultiplier(const std::vector<bool>& attributes_set) const {
float Game_Battler::GetAttributeMultiplier(const lcf::DBBitArray& attributes_set) const {
constexpr auto min_mod = std::numeric_limits<int>::min();
int physical = min_mod;
int magical = min_mod;
Expand Down
3 changes: 2 additions & 1 deletion src/game_battler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <vector>
#include <limits>
#include <lcf/rpg/state.h>
#include <lcf/dbbitarray.h>
#include "system.h"
#include "state.h"
#include "color.h"
Expand Down Expand Up @@ -203,7 +204,7 @@ class Game_Battler {
* @param attributes set for the incoming action
* @return effect multiplier
*/
float GetAttributeMultiplier(const std::vector<bool>& attributes_set) const;
float GetAttributeMultiplier(const lcf::DBBitArray& attributes_set) const;

/**
* Gets the characters name
Expand Down
2 changes: 1 addition & 1 deletion src/game_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ std::vector<int> Game_Map::GetEncountersAt(int x, int y) {
return false;
}

const std::vector<bool>& terrain_set = troop->terrain_set;
const auto& terrain_set = troop->terrain_set;

// RPG_RT optimisation: Omitted entries are the default value (true)
return terrain_set.size() <= (unsigned)(terrain_tag - 1) ||
Expand Down