File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -516,9 +516,16 @@ void Engine::step()
516
516
bool oldValue = false ;
517
517
auto hatBlock = thread->script ()->topBlock ();
518
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 );
519
+
520
+ // TODO: Edge-activated hats currently support only one field
521
+ // 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
+
522
529
auto it = m_edgeActivatedHatValues.find (hatType);
523
530
524
531
if (it == m_edgeActivatedHatValues.cend ()) {
You can’t perform that action at this time.
0 commit comments