Advertisement
Guest User

Untitled

a guest
Nov 19th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. int pc_near_water(lua_State* L)
  2. {
  3. LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();
  4. float fx, fy;
  5. GetDeltaByDegree(pChar->GetRotation(), 400.0f, &fx, &fy);
  6.  
  7. LPSECTREE tree = SECTREE_MANAGER::instance().Get(pChar->GetMapIndex(), (long)(pChar->GetX()+fx), (long)(pChar->GetY()+fy));
  8.  
  9. if (!tree)
  10. {
  11. lua_pushboolean(L, false);
  12. return 1;
  13. }
  14.  
  15. if (tree->IsAttr((long)(pChar->GetX()+fx), (long)(pChar->GetY()+fy), ATTR_WATER))
  16. {
  17. lua_pushboolean(L, true);
  18. }
  19. else
  20. {
  21. lua_pushboolean(L, false);
  22. }
  23.  
  24. return 1;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement