MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiDoRobotFire

Function MultiDoRobotFire

Descent3/multi.cpp:2097–2134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2095}
2096
2097void MultiDoRobotFire(uint8_t *data) {
2098 int count = 0;
2099 uint16_t obj_num;
2100 vector weapon_pos;
2101 vector weapon_dir;
2102 uint32_t weapon_num;
2103 uint32_t uniqueid;
2104
2105 if (Netgame.local_role == LR_SERVER) {
2106 Int3(); // Get Jason, a server got the multi do fire packet
2107 return;
2108 }
2109
2110 // mprintf(0,"*");
2111 SKIP_HEADER(data, &count);
2112 int serv_objnum = MultiGetUshort(data, &count);
2113 obj_num = Server_object_list[serv_objnum];
2114
2115 if (obj_num == 65535 || !(Objects[obj_num].flags & OF_SERVER_OBJECT)) {
2116 // Int3(); // Get Jason, invalid robot firing!
2117 return;
2118 }
2119
2120 // memcpy (&weapon_pos,&data[count],sizeof(vector));
2121 // count+=sizeof(vector);
2122 weapon_pos = MultiGetVector(data, &count);
2123 // memcpy (&weapon_dir,&data[count],sizeof(vector));
2124 // count+=sizeof(vector);
2125 weapon_dir = MultiGetVector(data, &count);
2126
2127 weapon_num = MultiGetUint(data, &count);
2128
2129 if (Objects[obj_num].type == 255)
2130 return;
2131 uniqueid = MultiMatchWeapon(weapon_num);
2132
2133 CreateAndFireWeapon(&weapon_pos, &weapon_dir, &Objects[obj_num], uniqueid);
2134}
2135
2136// Does a cool vis effect to announce a player or powerup
2137void MultiAnnounceEffect(object *obj, float size, float time) {

Callers 1

MultiProcessDataFunction · 0.85

Calls 6

SKIP_HEADERFunction · 0.85
MultiGetUshortFunction · 0.85
MultiGetVectorFunction · 0.85
MultiGetUintFunction · 0.85
MultiMatchWeaponFunction · 0.85
CreateAndFireWeaponFunction · 0.85

Tested by

no test coverage detected