View Issue Details

IDProjectCategoryView StatusLast Update
0005577Multi Theft Auto : San AndreasScriptingpublic2011-03-28 17:38
Reporterlil_ToadyAssigned Toccw 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target Version1.0.5Fixed in Version1.0.5 
Summary0005577: Some functions break coroutines
Description

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 ) )

TagsNo tags attached.

Activities

ccw

2011-02-21 20:26

administrator   ~~0012981

Last edited: 2011-02-21 20:53

Update of affected functions:

Client

GetElementsByType
GetElementChildren

Server

GetPlayersInTeam
GetTimers
GetVehiclesOfType

ccw

2011-02-21 22:53

administrator   ~~0012982

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.

  • What happens if the state is gone?
  • What about timers created in a coroutine?
  • And key/command binds?

arranTuna

2011-02-22 21:37

manager   ~~0012988

getBans doesn't work also - "attempt to index a thread value" with getBans inside a coroutine.

ccw

2011-03-04 23:44

administrator   ~~0013016

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=2427

Issue History

Date Modified Username Field Change