Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pc_near_water(lua_State* L)
- {
- LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();
- float fx, fy;
- GetDeltaByDegree(pChar->GetRotation(), 400.0f, &fx, &fy);
- LPSECTREE tree = SECTREE_MANAGER::instance().Get(pChar->GetMapIndex(), (long)(pChar->GetX()+fx), (long)(pChar->GetY()+fy));
- if (!tree)
- {
- lua_pushboolean(L, false);
- return 1;
- }
- if (tree->IsAttr((long)(pChar->GetX()+fx), (long)(pChar->GetY()+fy), ATTR_WATER))
- {
- lua_pushboolean(L, true);
- }
- else
- {
- lua_pushboolean(L, false);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement