MCPcopy Create free account
hub / github.com/assaultcube/AC / getvantagepoint

Function getvantagepoint

source/src/worldio.cpp:507–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505COMMAND(setvantagepoint, "");
506
507bool getvantagepoint(short p[5])
508{
509 int n = findheaderextra(HX_VANTAGEPOINT);
510 if(n >= 0)
511 {
512 ucharbuf q(headerextras[n]->data, headerextras[n]->len);
513 loopi(5) p[i] = getint(q);
514 if(!OUTBORD(p[0] / DMF, p[1] / DMF) && iabs(p[2]) < 127 * int(DMF) && p[3] >= 0 && p[3] < 360 && iabs(p[4]) <= 90) return true; // check for sane values
515 }
516 return false;
517}
518
519COMMANDF(getvantagepoint, "", ()
520{

Callers 2

worldio.cppFile · 0.85
gotovantagepointFunction · 0.85

Calls 4

findheaderextraFunction · 0.85
getintFunction · 0.85
iabsFunction · 0.85
loopiFunction · 0.70

Tested by

no test coverage detected