MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / tryAdd

Method tryAdd

src/OpenLoco/src/Vehicles/Routing.cpp:151–168  ·  view source on GitHub ↗

0x004A38DE & 0x004A3972

Source from the content-addressed store, hash-verified

149
150 // 0x004A38DE & 0x004A3972
151 bool tryAdd(LocationOfInterest& interest)
152 {
153 auto index = hash(interest);
154 for (; locs[index].loc != World::Pos3{ -1, -1, 0 }; ++index, index &= mapSizeMask)
155 {
156 if (get(index) == interest)
157 {
158 return false;
159 }
160 }
161 if (count >= maxEntries)
162 {
163 return false;
164 }
165 locs[index] = interest;
166 count++;
167 return true;
168 }
169
170 Iterator begin() const
171 {

Callers 8

findAllUsableTrackPiecesFunction · 0.80
findAllUsableRoadPiecesFunction · 0.80
applyTrackModToTrackFunction · 0.80
removeTrackModToTrackFunction · 0.80
applyRoadModToRoadFunction · 0.80
removeRoadModToTrackFunction · 0.80

Calls 1

getFunction · 0.50

Tested by

no test coverage detected