diff --git a/src/ai/goap.hpp b/src/ai/goap.hpp index ef06b2a..4ab861c 100644 --- a/src/ai/goap.hpp +++ b/src/ai/goap.hpp @@ -12,7 +12,6 @@ namespace ai { using AIProfile = std::unordered_map; constexpr const int SCORE_MAX = std::numeric_limits::max() / 2; - constexpr const size_t STATE_MAX = 32; using State = std::bitset; @@ -21,19 +20,14 @@ namespace ai { const State ALL_ONES = ~ALL_ZERO; struct Action { - std::string name; + std::string name=""; int cost = 0; - State $positive_preconds; - State $negative_preconds; + State $positive_preconds=ALL_ZERO; + State $negative_preconds=ALL_ZERO; - State $positive_effects; - State $negative_effects; - - Action() {} - - Action(std::string name, int cost) : - name(name), cost(cost) { } + State $positive_effects=ALL_ZERO; + State $negative_effects=ALL_ZERO; void needs(int name, bool val); void effect(int name, bool val); @@ -47,9 +41,9 @@ namespace ai { } }; - using Script = std::deque; - const Action FINAL_ACTION("END", SCORE_MAX); + using Script = std::deque; + const Action FINAL_ACTION{"END", SCORE_MAX}; struct ActionState { Action action; diff --git a/src/graphics/raycaster.cpp b/src/graphics/raycaster.cpp index a0c9be3..65ada38 100644 --- a/src/graphics/raycaster.cpp +++ b/src/graphics/raycaster.cpp @@ -96,6 +96,7 @@ void Raycaster::apply_sprite_effect(shared_ptr effect, float width, } std::shared_ptr Raycaster::apply_lighting_effect(components::Position& sprite_pos, matrix::Matrix &lights) { + // BUG: this is applying it to all sprites, put bottle far away then another close to see auto effect = $brightness; float level = lights[sprite_pos.location.y][sprite_pos.location.x] * PERCENT; // this boosts the brightness of anything we're aiming at