Active Member Exygo 1090 Posted July 18, 2018 Active Member Share Posted July 18, 2018 How the bug manifests? Client closes without any syserr How to reproduce the bug? Let' say you got textureset/metin2_map_c1.txt and inside you got an empty string like this: TextureSet TextureCount 17 Start Texture001 "" 5.000000 5.000000 0.000000 0.000000 0 0 0 End Texture001 Start Texture002 "d:\ymir work\terrainmaps\b\field\field 02.dds" 6.000000 6.000000 0.000000 0.000000 0 0 0 End Texture002 binary/src/source/PRTerrainLib/TextureSet.cpp Search this lin inside bool CTextureSet::SetTexture if (!pResource->IsType(CGraphicImage::Type())) And add before if (!pResource) return false; Search this line inside bool CTextureSet::AddTexture if (!pResource->IsType(CGraphicImage::Type())) And add before if (!pResource) return false; 6 https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
ridetpro 116 Posted July 18, 2018 Share Posted July 18, 2018 There is no such empty string in any textureset. But it's good to have this check. Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4873 Posted July 18, 2018 Bot Share Posted July 18, 2018 55 minutes ago, ridetpro said: There is no such empty string in any textureset. But it's good to have this check. Well, WorldEditor sometimes goes wild. 1 Link to comment Share on other sites More sharing options...
kasko30 19 Posted July 18, 2018 Share Posted July 18, 2018 I had this problem one time in charachterwindow.py back then i didn't know the problem cause the syserr was empty and yes the problem was that the path to the image files was like this: image: "", Thank you. Link to comment Share on other sites More sharing options...
Aerrow 41 Posted July 18, 2018 Share Posted July 18, 2018 (edited) Thanks for sharing us! But I think this way is much better and cleaner: if (!pResource || !pResource->IsType(CGraphicImage::Type())) Hmm, with this way it just simply crash, but if I make that small if separate from the pointer check it works. Can someone explain me this? As I know, when the program enter an if statement which contains an or gate, then check the first one and if it's true then skip the other ones. May I know wrong? Edited July 18, 2018 by Aerrow mistake Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted July 18, 2018 Active Member Share Posted July 18, 2018 Maybe something to log (not only return) Link to comment Share on other sites More sharing options...
Active Member Exygo 1090 Posted July 19, 2018 Author Active Member Share Posted July 19, 2018 15 hours ago, Aerrow said: Thanks for sharing us! But I think this way is much better and cleaner: if (!pResource || !pResource->IsType(CGraphicImage::Type())) Hmm, with this way it just simply crash, but if I make that small if separate from the pointer check it works. Can someone explain me this? As I know, when the program enter an if statement which contains an or gate, then check the first one and if it's true then skip the other ones. May I know wrong? It should not count at the speed of the code or other performance criteria but depends how obssessed you are. And yes as I know and experienced the first one should trigger the condition and then the other ones should be ignored. But if you look down at the line with TraceError as long as the pointer is NULL he can't call ->GetFileName() from a NULL pointer You should know that. In conclusion stop trying to impress 1 https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Aerrow 41 Posted July 20, 2018 Share Posted July 20, 2018 Gosh, right, I didn't notice that... Link to comment Share on other sites More sharing options...
Active Member Exygo 1090 Posted July 20, 2018 Author Active Member Share Posted July 20, 2018 On 7/18/2018 at 11:10 PM, hachiwari said: Maybe something to log (not only return) There is not reason for that. https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Recommended Posts