fix logic

This commit is contained in:
2025-08-29 20:06:45 -05:00
parent 17817cc6fa
commit ddd9aef869
3 changed files with 7 additions and 5 deletions

View File

@@ -1132,11 +1132,11 @@ std::vector<graph_node_t> global_node_graph(std::vector<cSpecial>& globals) {
node_properties_t props = *(special.type);
// Forward connections
for(int i = 1; i <= static_cast<int>(eSpecField::JUMP); ++i){
eSpecField fld = static_cast<eSpecField>(i);
for(int j = 1; j <= static_cast<int>(eSpecField::JUMP); ++j){
eSpecField fld = static_cast<eSpecField>(j);
if(props.get(special, fld).button == eSpecPicker::NODE){
if(special.get(fld) >= 0){
node.to_nodes.insert(std::make_pair(true, i));
node.to_nodes.insert(std::make_pair(true, special.get(fld)));
}
// TODO negative numbers can be pointers, which the graph can't follow,
// but that ambiguity or the pointer's identity could be noted on the graph
@@ -1149,7 +1149,7 @@ std::vector<graph_node_t> global_node_graph(std::vector<cSpecial>& globals) {
for(int i = 0; i < globals.size(); ++ i){
graph_node_t& node = graph_nodes[i];
for(node_id id : node.to_nodes){
graph_nodes[id.second].from_nodes.insert(id);
graph_nodes[id.second].from_nodes.insert(node.id);
}
}

View File

@@ -818,10 +818,11 @@ static void put_spec_enc_in_dlog(cDialog& me, node_stack_t& edit_stack) {
// Graph fun!
std::vector<graph_node_t> globals = global_node_graph(scenario.scen_specials);
graph_node_t which = globals[edit_stack.back().which];
for(node_id from_id : which.from_nodes){
LOG(fmt::format("{} -> {}", from_id.second, which.id.second));
}
for(node_id to_id : which.from_nodes){
for(node_id to_id : which.to_nodes){
LOG(fmt::format("{} -> {}", which.id.second, to_id.second));
}

View File

@@ -15,6 +15,7 @@
#include <list>
#include <memory>
#include <string>
#include <functional>
#include "location.hpp"
class cAction {