dreammaker 3 Posted July 6, 2015 Share Posted July 6, 2015 ---------------------------Microsoft Visual C++ Runtime Library---------------------------Assertion failed! Program: I:\40k GameClient\Metin2Debug.exeFile: ..\..\source\EterLib\Camera.cppLine: 261 Expression: m_fDistance >= 0 --------------------------------------------------------------------------------------------------------------------------- This is client log: 0706 21:35:09784 :: SYSERR: Traceback (most recent call last): 0706 21:35:09784 :: SYSERR: File "uiTarget.py", line 479, in OnUpdate 0706 21:35:09785 :: SYSERR: UnboundLocalError0706 21:35:09785 :: SYSERR: :0706 21:35:09785 :: SYSERR: local variable 'exchangeButton' referenced before assignment0706 21:35:09785 :: SYSERR: --------------------------------------------------------------------------------------------------------------------------- This is code block in python: def OnUpdate(self): distance = 0 // I added this definition for the error in this blok// if player.IsPVPInstance(self.vid): constInfo.VID = self.vid event.QuestButtonClick(constInfo.STHX) if not self.healthBoard.IsShow() and self.vid != 0: self.healthBoard.Show() else: self.healthBoard.Hide() if self.isShowButton: exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE] distance = player.GetCharacterDistance(self.vid) if distance < 0: return distance // this solved problem > local variable 'distance' referenced before assignment if exchangeButton.IsShow(): if distance > self.EXCHANGE_LIMIT_RANGE: self.RefreshButton() else: if distance < self.EXCHANGE_LIMIT_RANGE: self.RefreshButton() Above code block keep giving this error . I dont know what can I do Link to comment Share on other sites More sharing options...
BigBoss 0 Posted April 1, 2019 Share Posted April 1, 2019 Bump I have the same error, any solutions? Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted April 1, 2019 Premium Share Posted April 1, 2019 What are you trying to install guys terrible... Link to comment Share on other sites More sharing options...
Forum Moderator Raylee 656 Posted April 1, 2019 Forum Moderator Share Posted April 1, 2019 On 4/1/2019 at 5:45 PM, BigBoss said: Bump I have the same error, any solutions? I would prefer to create a new topic where you describe your issue. And maybe you can give us more informations. Best regards Raylee Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10270 Posted April 4, 2019 Forum Moderator Share Posted April 4, 2019 On 4/1/2019 at 6:45 PM, BigBoss said: Bump I have the same error, any solutions? You declared the variable into a if condition and then you try to call it from outside, that's wrong. def main(condition): if condition: variable = 100 print variable main(True) << 100 main(False) << Traceback (most recent call last): << File "main.py", line 6, in <module> << main(False) << File "main.py", line 4, in main << print variable << UnboundLocalError: local variable 'variable' referenced before assignment So, your problem is exchangeButton, declare it before condition if self.isShowButton, like: def OnUpdate(self): exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE] [.....] 3 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now