Puts player "slot" position info into the passed in buffer Returns the number of bytes used
| 1998 | // Puts player "slot" position info into the passed in buffer |
| 1999 | // Returns the number of bytes used |
| 2000 | int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data) { |
| 2001 | int size; |
| 2002 | int count = 0; |
| 2003 | //@@multi_orientation mat; |
| 2004 | |
| 2005 | // mprintf(0,"!");//KBTEST |
| 2006 | object *obj = &Objects[objectnum]; |
| 2007 | |
| 2008 | ASSERT(obj->flags & OF_CLIENT_KNOWS); |
| 2009 | |
| 2010 | size = START_DATA(MP_ROBOT_POS, data, &count); |
| 2011 | MultiAddUshort(objectnum, data, &count); |
| 2012 | |
| 2013 | // Do position |
| 2014 | MultiAddPositionData(&obj->pos, data, &count); |
| 2015 | |
| 2016 | // Do orientation |
| 2017 | |
| 2018 | // Do orientation |
| 2019 | angvec angs; |
| 2020 | vm_ExtractAnglesFromMatrix(&angs, &obj->orient); |
| 2021 | |
| 2022 | MultiAddShort(angs.p, data, &count); |
| 2023 | MultiAddShort(angs.h, data, &count); |
| 2024 | MultiAddShort(angs.b, data, &count); |
| 2025 | |
| 2026 | // Do roomnumber and terrain flag |
| 2027 | |
| 2028 | MultiAddShort(CELLNUM(obj->roomnum), data, &count); |
| 2029 | |
| 2030 | if (OBJECT_OUTSIDE(obj)) |
| 2031 | MultiAddByte(1, data, &count); |
| 2032 | else |
| 2033 | MultiAddByte(0, data, &count); |
| 2034 | |
| 2035 | vector *vel = &obj->mtype.phys_info.velocity; |
| 2036 | vector *rotvel = &obj->mtype.phys_info.rotvel; |
| 2037 | |
| 2038 | MultiAddShort((vel->x * 128.0), data, &count); |
| 2039 | MultiAddShort((vel->y * 128.0), data, &count); |
| 2040 | MultiAddShort((vel->z * 128.0), data, &count); |
| 2041 | |
| 2042 | END_DATA(count, data, size); |
| 2043 | return count; |
| 2044 | } |
| 2045 | |
| 2046 | // Puts player "slot" position info into the passed in buffer |
| 2047 | // Returns the number of bytes used |
no test coverage detected