We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56af9bd commit 8039bf5Copy full SHA for 8039bf5
1 file changed
src/engine/internal/engine.cpp
@@ -505,9 +505,16 @@ void Engine::step()
505
bool oldValue = false;
506
auto hatBlock = thread->script()->topBlock();
507
assert(hatBlock);
508
- assert(hatBlock->fieldAt(0)); // TODO: Edge-activated hats currently support only one field
509
- int fieldValueId = hatBlock->fieldAt(0)->specialValueId();
510
- 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
511
+ int fieldValueId = -1;
512
513
+ if (hatBlock->fieldAt(0)) {
514
+ fieldValueId = hatBlock->fieldAt(0)->specialValueId();
515
+ assert(fieldValueId != -1);
516
+ }
517
518
auto it = m_edgeActivatedHatValues.find(hatType);
519
520
if (it == m_edgeActivatedHatValues.cend()) {
0 commit comments