dreammaker 3 Posted July 19, 2015 Share Posted July 19, 2015 char_battle.cpp:bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType) if (pkVictim->GetShopOwner()) return false; I added this code to prevent hitting private shops.But it doenst work.I can still hit and kill players shops .What is wrong ? Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted July 20, 2015 Premium Share Posted July 20, 2015 GetShopOwner() will return the owner of the current shop opened. Use this: if (pkVictim->GetMyShop()) return false; 2 Link to comment Share on other sites More sharing options...
dreammaker 3 Posted July 20, 2015 Author Share Posted July 20, 2015 GetShopOwner() will return the owner of the current shop opened. Use this: if (pkVictim->GetMyShop()) return false; Thank you very much Cataclismo It really worked.I wish I know C++. It is hard to learn for beginners Link to comment Share on other sites More sharing options...
ruiskyo1 1 Posted July 20, 2015 Share Posted July 20, 2015 Its not about knowing c++ or not, its about knowing the functions and how they work... in 1 weak you learn basic level c++(variables, funtions, etc) 1 Link to comment Share on other sites More sharing options...
dreammaker 3 Posted July 21, 2015 Author Share Posted July 21, 2015 if (pkVictim->GetMyShop()) return false; This code worked but some weird thing happened.It prevents straight hits but doesnt prevent some skills like: warriors dash and sura's remove magic What can be the problem ? Thanks. Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted July 21, 2015 Premium Share Posted July 21, 2015 Well... Open battle.cpp and find bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim) And after if (victim->IsDead()) return false; Add: if (victim->GetMyShop()) return false; Tell me if that works. 1 Link to comment Share on other sites More sharing options...
dreammaker 3 Posted July 21, 2015 Author Share Posted July 21, 2015 Thank you very much Cataclismo I tried and It worked like a charm 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