Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. EVENTFUNC(hide_weapon_event)
  2. {
  3. hide_weapon_info * info = dynamic_cast<hide_weapon_info*>( event->info );
  4.  
  5. if (info == NULL)
  6. {
  7. sys_err("hide_weapon_info> <Factor> Null pointer");
  8. return 0;
  9. }
  10.  
  11. if(processing_time == NULL)
  12. {
  13. return 0;
  14. }
  15.  
  16. LPCHARACTER ch = info->me;
  17. LPCHARACTER target = info->target;
  18.  
  19. if (ch)
  20. {
  21. if (ch->GetWear(WEAR_WEAPON)->GetLook() > 0)
  22. ch->SetPart(PART_WEAPON, ch->GetWear(WEAR_WEAPON) ? ch->GetWear(WEAR_WEAPON)->GetLook() : 0);
  23. else
  24. ch->SetPart(PART_WEAPON, ch->GetWear(WEAR_WEAPON) ? ch->GetWear(WEAR_WEAPON)->GetVnum() : 0);
  25.  
  26. ch->UpdatePacket();
  27. }
  28.  
  29. if (!target)
  30. {
  31. return 0;
  32. }
  33. if (target)
  34. {
  35. if (target->GetWear(WEAR_WEAPON)->GetLook() > 0)
  36. target->SetPart(PART_WEAPON, target->GetWear(WEAR_WEAPON) ? target->GetWear(WEAR_WEAPON)->GetLook() : 0);
  37. else
  38. target->SetPart(PART_WEAPON, target->GetWear(WEAR_WEAPON) ? target->GetWear(WEAR_WEAPON)->GetVnum() : 0);
  39.  
  40. target->UpdatePacket();
  41. }
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement