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 @@ -505,9 +505,16 @@ void Engine::step()
505505 bool oldValue = false ;
506506 auto hatBlock = thread->script ()->topBlock ();
507507 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 );
508+
509+ // TODO: Edge-activated hats currently support only one field
510+ // 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+
511518 auto it = m_edgeActivatedHatValues.find (hatType);
512519
513520 if (it == m_edgeActivatedHatValues.cend ()) {
You can’t perform that action at this time.
0 commit comments