()
| 1291 | * ================= |
| 1292 | */ |
| 1293 | static void AddPlayerBeams() { |
| 1294 | float d; |
| 1295 | //entity_t ent = new entity_t(); |
| 1296 | float yaw, pitch; |
| 1297 | float forward; |
| 1298 | float len, steps; |
| 1299 | int framenum = 0; |
| 1300 | float model_length; |
| 1301 | |
| 1302 | float hand_multiplier; |
| 1303 | frame_t oldframe; |
| 1304 | player_state_t ps, ops; |
| 1305 | |
| 1306 | // PMM |
| 1307 | if (ClientGlobals.hand != null) { |
| 1308 | if (ClientGlobals.hand.value == 2) |
| 1309 | hand_multiplier = 0; |
| 1310 | else if (ClientGlobals.hand.value == 1) |
| 1311 | hand_multiplier = -1; |
| 1312 | else |
| 1313 | hand_multiplier = 1; |
| 1314 | } else { |
| 1315 | hand_multiplier = 1; |
| 1316 | } |
| 1317 | // PMM |
| 1318 | |
| 1319 | // update beams |
| 1320 | beam_t[] b = cl_playerbeams; |
| 1321 | for (int i = 0; i < MAX_BEAMS; i++) { |
| 1322 | |
| 1323 | if (b[i].model == null || b[i].endtime < ClientGlobals.cl.time) |
| 1324 | continue; |
| 1325 | |
| 1326 | if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)) { |
| 1327 | |
| 1328 | // if coming from the player, update the start position |
| 1329 | if (b[i].entity == ClientGlobals.cl.playernum + 1) // entity 0 is the |
| 1330 | // world |
| 1331 | { |
| 1332 | // set up gun position |
| 1333 | // code straight out of CL_AddViewWeapon |
| 1334 | ps = ClientGlobals.cl.frame.playerstate; |
| 1335 | int j = (ClientGlobals.cl.frame.serverframe - 1) |
| 1336 | & Defines.UPDATE_MASK; |
| 1337 | oldframe = ClientGlobals.cl.frames[j]; |
| 1338 | |
| 1339 | if (oldframe.serverframe != ClientGlobals.cl.frame.serverframe - 1 |
| 1340 | || !oldframe.valid) |
| 1341 | oldframe = ClientGlobals.cl.frame; // previous frame was |
| 1342 | // dropped or involid |
| 1343 | |
| 1344 | ops = oldframe.playerstate; |
| 1345 | for (j = 0; j < 3; j++) { |
| 1346 | b[i].start[j] = ClientGlobals.cl.refdef.vieworg[j] |
| 1347 | + ops.gunoffset[j] + ClientGlobals.cl.lerpfrac |
| 1348 | * (ps.gunoffset[j] - ops.gunoffset[j]); |
| 1349 | } |
| 1350 | Math3D.VectorMA(b[i].start, |
no test coverage detected