View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005577||Multi Theft Auto : San Andreas||Scripting||public||2010-09-24 14:12||2011-03-28 17:38|
|Target Version||1.0.5||Fixed in Version||1.0.5|
|Summary||0005577: Some functions break coroutines|
Client side: getElementChildren, getElementsByType
Those functions use CLuaMain to get through the element tree which gets the main lua_State, yet if those functions are called from a coroutine they have a different lua_State. This mismatch causes troubles.
CLuaMain should provide a method to get lua_State in use but not the main one.
|Steps To Reproduce|
coroutine.resume ( coroutine.create ( function() getElementsByType ( "player" ) end ) )
|Tags||No tags attached.|
Update of affected functions:
Admin2 looks like it's adding event handlers from inside a coroutine.
If so, I presume you want the triggered event to be run with the original coroutine state.
getBans doesn't work also - "attempt to index a thread value" with getBans inside a coroutine.