Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. PIXEL_POSITION pos;
  2. long x = ch->GetX();
  3. long y = ch->GetY();
  4.  
  5. long new_x = pinfo->lX;
  6. long new_y = pinfo->lY;
  7.  
  8. float fx, fy;
  9. GetDeltaByDegree(ch->GetRotation(), 500.0f, &fx, &fy);
  10.  
  11. LPSECTREE tree = SECTREE_MANAGER::instance().Get(ch->GetMapIndex(), (long)x, (long)y);
  12. LPSECTREE new_tree = SECTREE_MANAGER::instance().Get(ch->GetMapIndex(), (long)(new_x+fx), (long)(new_y+fy));
  13.  
  14. if (tree && tree->IsAttr((long)x, (long)y, ATTR_BLOCK) && new_tree && new_tree->IsAttr((long)(new_x+fx), (long)(ch->GetY()+fy), ATTR_BLOCK))
  15. {
  16. ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
  17. ch->Stop();
  18. return;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement