There was an error while loading. Please reload this page.
1 parent f9ee2fc commit 53bec00Copy full SHA for 53bec00
1 file changed
src/engine/internal/engine.cpp
@@ -516,9 +516,16 @@ void Engine::step()
516
bool oldValue = false;
517
auto hatBlock = thread->script()->topBlock();
518
assert(hatBlock);
519
- assert(hatBlock->fieldAt(0)); // TODO: Edge-activated hats currently support only one field
520
- int fieldValueId = hatBlock->fieldAt(0)->specialValueId();
521
- assert(fieldValueId != -1);
+
+ // TODO: Edge-activated hats currently support only one field
+ // If there isn't any field, -1 is used as the field value ID
522
+ int fieldValueId = -1;
523
524
+ if (hatBlock->fieldAt(0)) {
525
+ fieldValueId = hatBlock->fieldAt(0)->specialValueId();
526
+ assert(fieldValueId != -1);
527
+ }
528
529
auto it = m_edgeActivatedHatValues.find(hatType);
530
531
if (it == m_edgeActivatedHatValues.cend()) {
0 commit comments