fix crash on double ES.

code should ensure that a call to SetCurrentSteps passes steps that match the
current StyleType
This commit is contained in:
Devin J. Pohly
2013-01-02 14:07:03 -05:00
parent c5d566c641
commit 9e6d161743
+1 -1
View File
@@ -2223,7 +2223,7 @@ public:
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
if( lua_isnil(L,2) ) { p->m_pCurSteps[pn].Set( NULL ); }
else { Steps *pS = Luna<Steps>::check(L,2); p->m_pCurSteps[pn].Set( pS ); }
GAMESTATE->SetCurrentStyle( GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), p->m_pCurSteps[pn]->m_StepsType ));
ASSERT(p->m_pCurSteps[pn]->m_StepsType == p->m_pCurStyle->m_StepsType);
// Why Broadcast again? This is double-broadcasting. -Chris
MESSAGEMAN->Broadcast( (MessageID)(Message_CurrentStepsP1Changed+pn) );