Advertisement
techforce

Against_wall()

May 6th, 2013
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. float (entity pse) against_wall =
  3. {
  4. // (org + (x * v_forward) + (y * v_right) + (z * v_up))
  5. local float score;
  6. makevectors (pse.v_angle);
  7. traceline (pse.spawnorigin, pse.origin + '25 0 0' ,FALSE, pse);
  8. if (trace_fraction != 1)
  9. {
  10. score = score + 1;
  11. //bprint (" near wall on right.....\n");
  12. }
  13. //SpawnTempDebugMarker (trace_endpos);
  14. makevectors (pse.v_angle);
  15. traceline (pse.spawnorigin, pse.origin + '-25 0 0' ,FALSE, pse);
  16. if (trace_fraction != 1)
  17. {
  18. score = score + 1;
  19. //bprint (" near wall on left.....\n");
  20. }
  21.  
  22. //SpawnTempDebugMarker (trace_endpos);
  23. makevectors (pse.v_angle);
  24. traceline (pse.spawnorigin, pse.origin + '0 25 0' ,FALSE, pse);
  25. if (trace_fraction != 1)
  26. {
  27. score = score + 1;
  28. //bprint (" near wall in front.....\n");
  29. }
  30. //SpawnTempDebugMarker (trace_endpos);
  31. makevectors (pse.v_angle);
  32. traceline (pse.spawnorigin, pse.origin + '0 -25 0' ,FALSE, pse);
  33. if (trace_fraction != 1)
  34. {
  35. score = score + 1;
  36. //bprint (" near wall at rear.....\n");
  37. }
  38. //SpawnTempDebugMarker (trace_endpos);
  39.  
  40. if (!score)
  41. return (FALSE);
  42. else
  43. return (TRUE);
  44. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement