Sign in to follow this  
BornToCode

AngelScript Bug

Recommended Posts

using the string class. If you create a global variable of that type and then pass that to the c++ side, when you get the object address it gives me garbage. if i do this it works. class MM { string switchName; MM(){ switchName=""; } } MM mm; void CheckIfItemCollected(Sprite& s) { Map@ map = GetCurrentMap(); string mapName; map.Name(mapName); mm.switchName = "hasItem"+mapName+s.name; Print("1"+mm.switchName); if (game.GetGlobalVariable(mm.switchName) == SWITCH_ON) { Print("2"+mm.switchName); s.visible = false; s.Release(); } else { Print("3"+mm.switchName); game.SetGlobalVariable(mm.switchName,SWITCH_OFF); } } but if i do not use the class and just use string switchname as a global variable then it crashes when i pass switchname to GetGlobalVariable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this