You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 22, 2025. It is now read-only.
RawDatum* datum = Core::GetDatumPointerById(datum_id);
62
62
if (datum != nullptr) {
63
-
std::shared_ptr<GasMixture> *gm = nullptr;
63
+
std::shared_ptr<GasMixture>* gm = nullptr;
64
64
if (datum->len_vars < 10) { // if it has a whole bunch of vars it's probably not a gas mixture. Please don't add a whole bunch of vars to gas mixtures.
65
65
for (int i = 0; i < datum->len_vars; i++) {
66
66
if (datum->vars[i].id == str_id_extools_pointer) {
@@ -168,7 +168,7 @@ trvh gasmixture_get_last_share(unsigned int args_len, Value* args, Value src)
168
168
trvh gasmixture_get_gases(unsignedint args_len, Value* args, Value src)
169
169
{
170
170
List l(CreateList(0));
171
-
GasMixture &gm = *get_gas_mixture(src);
171
+
GasMixture& gm = *get_gas_mixture(src);
172
172
for (int i = 0; i < TOTAL_NUM_GASES; i++) {
173
173
if (gm.get_moles(i) >= GAS_MIN_MOLES) {
174
174
l.append(gas_id_to_type[i]);
@@ -183,10 +183,12 @@ trvh gasmixture_set_temperature(unsigned int args_len, Value* args, Value src)
183
183
if (std::isnan(vf) || std::isinf(vf)) {
184
184
get_gas_mixture(src)->set_temperature(0);
185
185
Runtime("Attempt to set temperature to NaN or Infinity");
186
-
} elseif(vf < 0) {
186
+
}
187
+
elseif (vf < 0) {
187
188
get_gas_mixture(src)->set_temperature(0);
188
189
Runtime("Attempt to set temperature to negative number");
189
-
} else {
190
+
}
191
+
else {
190
192
get_gas_mixture(src)->set_temperature(vf);
191
193
}
192
194
returnValue::Null();
@@ -215,10 +217,12 @@ trvh gasmixture_set_moles(unsigned int args_len, Value* args, Value src)
215
217
if (std::isnan(vf) || std::isinf(vf)) {
216
218
get_gas_mixture(src)->set_moles(index, 0);
217
219
Runtime("Attempt to set moles to NaN or Infinity");
218
-
} elseif(vf < 0) {
220
+
}
221
+
elseif (vf < 0) {
219
222
get_gas_mixture(src)->set_moles(index, 0);
220
223
Runtime("Attempt to set moles to negative number");
221
-
} else {
224
+
}
225
+
else {
222
226
get_gas_mixture(src)->set_moles(index, vf);
223
227
}
224
228
returnValue::Null();
@@ -228,8 +232,8 @@ trvh gasmixture_scrub_into(unsigned int args_len, Value* args, Value src)
228
232
{
229
233
if (args_len < 2)
230
234
returnValue::Null();
231
-
GasMixture &src_gas = *get_gas_mixture(src);
232
-
GasMixture &dest_gas = *get_gas_mixture(args[0]);
235
+
GasMixture& src_gas = *get_gas_mixture(src);
236
+
GasMixture& dest_gas = *get_gas_mixture(args[0]);
233
237
Container gases_to_scrub = args[1];
234
238
int num_gases = gases_to_scrub.length();
235
239
GasMixture buffer(CELL_VOLUME);
@@ -268,7 +272,8 @@ trvh gasmixture_compare(unsigned int args_len, Value* args, Value src)
268
272
}
269
273
elseif (result == -2) {
270
274
returnValue("");
271
-
} else{
275
+
}
276
+
else {
272
277
return gas_id_to_type[result];
273
278
}
274
279
}
@@ -282,7 +287,7 @@ trvh gasmixture_multiply(unsigned int args_len, Value* args, Value src)
282
287
trvh turf_update_adjacent(unsignedint args_len, Value* args, Value src)
283
288
{
284
289
if (src.type != TURF) { returnValue::Null(); }
285
-
Tile *tile = all_turfs.get(src.value);
290
+
Tile* tile = all_turfs.get(src.value);
286
291
if (tile != nullptr) {
287
292
tile->update_adjacent(all_turfs);
288
293
}
@@ -292,7 +297,7 @@ trvh turf_update_adjacent(unsigned int args_len, Value* args, Value src)
292
297
trvh turf_update_air_ref(unsignedint args_len, Value* args, Value src)
293
298
{
294
299
if (src.type != TURF) { returnValue::Null(); }
295
-
Tile *tile = all_turfs.get(src.value);
300
+
Tile* tile = all_turfs.get(src.value);
296
301
if (tile != nullptr) {
297
302
tile->update_air_ref();
298
303
}
@@ -302,7 +307,7 @@ trvh turf_update_air_ref(unsigned int args_len, Value* args, Value src)
302
307
trvh turf_eg_reset_cooldowns(unsignedint args_len, Value* args, Value src)
303
308
{
304
309
if (src.type != TURF) { returnValue::Null(); }
305
-
Tile *tile = all_turfs.get(src.value);
310
+
Tile* tile = all_turfs.get(src.value);
306
311
if (tile != nullptr) {
307
312
if (tile->excited_group) {
308
313
tile->excited_group->reset_cooldowns();
@@ -314,7 +319,7 @@ trvh turf_eg_reset_cooldowns(unsigned int args_len, Value* args, Value src)
314
319
trvh turf_eg_garbage_collect(unsignedint args_len, Value* args, Value src)
315
320
{
316
321
if (src.type != TURF) { returnValue::Null(); }
317
-
Tile *tile = all_turfs.get(src.value);
322
+
Tile* tile = all_turfs.get(src.value);
318
323
if (tile != nullptr) {
319
324
if (tile->excited_group) {
320
325
// store to local variable to prevent it from being destructed while we're still using it because that causes segfaults.
@@ -328,7 +333,7 @@ trvh turf_eg_garbage_collect(unsigned int args_len, Value* args, Value src)
328
333
trvh turf_get_excited(unsignedint args_len, Value* args, Value src)
329
334
{
330
335
if (src.type != TURF) { returnValue::Null(); }
331
-
Tile *tile = all_turfs.get(src.value);
336
+
Tile* tile = all_turfs.get(src.value);
332
337
if (tile != nullptr) {
333
338
returnValue(tile->excited ? 1.0 : 0.0);
334
339
}
@@ -337,7 +342,7 @@ trvh turf_get_excited(unsigned int args_len, Value* args, Value src)
337
342
trvh turf_set_excited(unsignedint args_len, Value* args, Value src)
0 commit comments