def on_client_explode(self, client, cmillis, gun, explode_id, hits): if gun == weapon_types.GUN_RL: if not explode_id in client.state.rockets.keys(): return del client.state.rockets[explode_id] elif gun == weapon_types.GUN_GL: if not explode_id in client.state.grenades.keys(): return del client.state.grenades[explode_id] with self.broadcastbuffer(1, True, [client]) as cds: swh.put_explodefx(cds, client, gun, explode_id) if gun == weapon_types.GUN_SG: max_rays = SGRAYS else: max_rays = 1 total_rays = 0 for hit in hits: total_rays += hit['rays'] if total_rays > max_rays: break self.on_client_hit(client, gun, **hit)