mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	rulegen3:: more careful when adding to important
This commit is contained in:
		
							
								
								
									
										17
									
								
								rulegen3.cpp
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								rulegen3.cpp
									
									
									
									
									
								
							| @@ -195,6 +195,9 @@ int last_qroad; | |||||||
|  |  | ||||||
| vector<vector<pair<int,int>>> possible_parents; | vector<vector<pair<int,int>>> possible_parents; | ||||||
|  |  | ||||||
|  | set<tcell*> imp_as_set; | ||||||
|  | int impcount; | ||||||
|  |  | ||||||
| struct vcell { | struct vcell { | ||||||
|   int tid; |   int tid; | ||||||
|   vector<int> adj; |   vector<int> adj; | ||||||
| @@ -218,6 +221,14 @@ int get_abs_rule(int tid, int j) { | |||||||
|   return ts.rules[j1]; |   return ts.rules[j1]; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | void be_important(tcell *c) { | ||||||
|  |   if(imp_as_set.count(c)) { | ||||||
|  |     return; | ||||||
|  |     } | ||||||
|  |   important.push_back(c); | ||||||
|  |   imp_as_set.insert(c); | ||||||
|  |   } | ||||||
|  |  | ||||||
| void build(vstate& vs, vector<tcell*>& places, int where, int where_last, tcell *g) { | void build(vstate& vs, vector<tcell*>& places, int where, int where_last, tcell *g) { | ||||||
|   places[where] = g; |   places[where] = g; | ||||||
|   // twalker wh = g; |   // twalker wh = g; | ||||||
| @@ -231,8 +242,10 @@ void build(vstate& vs, vector<tcell*>& places, int where, int where_last, tcell | |||||||
|       twalker wh1 = g1; |       twalker wh1 = g1; | ||||||
|       auto ts = get_treestate_id(wh1).second; |       auto ts = get_treestate_id(wh1).second; | ||||||
|       if(ts != rule) { |       if(ts != rule) { | ||||||
|         important.push_back(g); |         be_important(g); | ||||||
|         important.push_back(g1); |         // be_important(treestates[ts0.second].giver.at); | ||||||
|  |         be_important(g1); | ||||||
|  |         // be_important(treestates[ts].giver.at); | ||||||
|         continue; |         continue; | ||||||
|         } |         } | ||||||
|       build(vs, places, c.adj[i], where, g1); |       build(vs, places, c.adj[i], where, g1); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue