X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fnades%2Fnades.qc;h=fdbddc80a90e88b59d95c6924a71a54e205d4218;hp=353baa96097b22fae19f3185d94217afc7b1db11;hb=a73f79e356dd25b6ea678379e7884ee45cc1977b;hpb=2300937585fd409c578a516ed5e051ba389646d4 diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 353baa960..fdbddc80a 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -94,7 +94,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile) proj.maxs = '16 16 16'; } proj.colormod = nade_type.m_color; - proj.move_movetype = MOVETYPE_BOUNCE; + set_movetype(proj, MOVETYPE_BOUNCE); settouch(proj, func_null); proj.scale = 1.5; proj.avelocity = randomvec() * 720; @@ -163,7 +163,7 @@ void nade_timer_think(entity this) this.skin = 8 - (this.owner.wait - time) / (autocvar_g_nades_nade_lifetime / 10); this.nextthink = time; if(!this.owner || wasfreed(this.owner)) - remove(this); + delete(this); } void nade_burn_spawn(entity _nade) @@ -232,13 +232,13 @@ void napalm_ball_think(entity this) if(round_handler_IsActive()) if(!round_handler_IsRoundStarted()) { - remove(this); + delete(this); return; } if(time > this.pushltime) { - remove(this); + delete(this); return; } @@ -273,7 +273,7 @@ void nade_napalm_ball(entity this) proj.team = this.owner.team; proj.bot_dodge = true; proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage; - proj.movetype = MOVETYPE_BOUNCE; + set_movetype(proj, MOVETYPE_BOUNCE); proj.projectiledeathtype = DEATH_NADE_NAPALM.m_id; PROJECTILE_MAKETRIGGER(proj); setmodel(proj, MDL_Null); @@ -294,6 +294,7 @@ void nade_napalm_ball(entity this) proj.angles = vectoangles(proj.velocity); proj.flags = FL_PROJECTILE; + IL_PUSH(g_projectiles, proj); proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC; //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true); @@ -306,13 +307,13 @@ void napalm_fountain_think(entity this) if(round_handler_IsActive()) if(!round_handler_IsRoundStarted()) { - remove(this); + delete(this); return; } if(time >= this.ltime) { - remove(this); + delete(this); return; } @@ -356,7 +357,7 @@ void nade_napalm_boom(entity this) fountain.ltime = time + autocvar_g_nades_napalm_fountain_lifetime; fountain.pushltime = fountain.ltime; fountain.team = this.team; - fountain.movetype = MOVETYPE_TOSS; + set_movetype(fountain, MOVETYPE_TOSS); fountain.projectiledeathtype = DEATH_NADE_NAPALM.m_id; fountain.bot_dodge = true; fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage; @@ -379,7 +380,7 @@ void nade_ice_think(entity this) if(round_handler_IsActive()) if(!round_handler_IsRoundStarted()) { - remove(this); + delete(this); return; } @@ -396,7 +397,7 @@ void nade_ice_think(entity this) Damage_DamageInfo(this.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, this.projectiledeathtype, 0, this); } - remove(this); + delete(this); return; } @@ -448,7 +449,7 @@ void nade_ice_boom(entity this) fountain.ltime = time + autocvar_g_nades_ice_freeze_time; fountain.pushltime = fountain.wait = fountain.ltime; fountain.team = this.team; - fountain.movetype = MOVETYPE_TOSS; + set_movetype(fountain, MOVETYPE_TOSS); fountain.projectiledeathtype = DEATH_NADE_ICE.m_id; fountain.bot_dodge = false; setsize(fountain, '-16 -16 -16', '16 16 16'); @@ -494,7 +495,7 @@ void nade_spawn_boom(entity this) entity spawnloc = spawn(); setorigin(spawnloc, this.origin); setsize(spawnloc, this.realowner.mins, this.realowner.maxs); - spawnloc.movetype = MOVETYPE_NONE; + set_movetype(spawnloc, MOVETYPE_NONE); spawnloc.solid = SOLID_NOT; spawnloc.drawonlytoclient = this.realowner; spawnloc.effects = EF_STARDUST; @@ -502,7 +503,7 @@ void nade_spawn_boom(entity this) if(this.realowner.nade_spawnloc) { - remove(this.realowner.nade_spawnloc); + delete(this.realowner.nade_spawnloc); this.realowner.nade_spawnloc = NULL; } @@ -513,7 +514,7 @@ void nades_orb_think(entity this) { if(time >= this.ltime) { - remove(this); + delete(this); return; } @@ -572,13 +573,11 @@ void nade_entrap_touch(entity this, entity toucher) if(!pushdeltatime) return; // div0: ticrate independent, 1 = identity (not 20) -#ifdef SVQC toucher.velocity = toucher.velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime); + #ifdef SVQC UpdateCSQCProjectile(toucher); -#elif defined(CSQC) - toucher.move_velocity = toucher.move_velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime); -#endif + #endif } if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) ) @@ -739,7 +738,7 @@ void nade_boom(entity this) RemoveGrapplingHook(it.realowner); }); - remove(this); + delete(this); } void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, string pntype); @@ -767,13 +766,13 @@ void nade_touch(entity this, entity toucher) if(autocvar_g_nades_pickup) if(time >= this.spawnshieldtime) if(!toucher.nade && this.health == this.max_health) // no boosted shot pickups, thank you very much - if(!toucher.frozen) + if(!STAT(FROZEN, toucher)) if(CanThrowNade(toucher)) // prevent some obvious things, like dead players if(IS_REAL_CLIENT(toucher)) // above checks for IS_PLAYER, don't need to do it here { nade_pickup(toucher, this); sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX)); - remove(this); + delete(this); return; } /*float is_weapclip = 0; @@ -788,7 +787,7 @@ void nade_touch(entity this, entity toucher) if(it.classname == "grapplinghook") RemoveGrapplingHook(it.realowner); }); - remove(this); + delete(this); return; } @@ -886,7 +885,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) entity _nade = e.nade; e.nade = NULL; - remove(e.fake_nade); + delete(e.fake_nade); e.fake_nade = NULL; makevectors(e.v_angle); @@ -909,7 +908,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) setsize(_nade, '-8 -8 -8', '8 8 8'); else setsize(_nade, '-16 -16 -16', '16 16 16'); - _nade.movetype = MOVETYPE_BOUNCE; + set_movetype(_nade, MOVETYPE_BOUNCE); tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade); if (trace_startsolid) @@ -943,6 +942,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) _nade.damagedbycontents = true; _nade.angles = vectoangles(_nade.velocity); _nade.flags = FL_PROJECTILE; + IL_PUSH(g_projectiles, _nade); _nade.projectiledeathtype = DEATH_NADE.m_id; _nade.toss_time = time; _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX); @@ -1067,10 +1067,10 @@ void nade_prime(entity this) return; // only allow bonus nades if(this.nade) - remove(this.nade); + delete(this.nade); if(this.fake_nade) - remove(this.fake_nade); + delete(this.fake_nade); int ntype; string pntype = this.pokenade_type; @@ -1151,9 +1151,9 @@ void nades_CheckThrow(entity this) void nades_Clear(entity player) { if(player.nade) - remove(player.nade); + delete(player.nade); if(player.fake_nade) - remove(player.fake_nade); + delete(player.fake_nade); player.nade = player.fake_nade = NULL; player.nade_timer = 0; @@ -1174,7 +1174,7 @@ CLASS(NadeOffhand, OffhandWeapon) if (held_nade) { player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / autocvar_g_nades_nade_lifetime, 1); - // LOG_TRACEF("%d %d\n", player.nade_timer, time - held_nade.nade_time_primed); + // LOG_TRACEF("%d %d", player.nade_timer, time - held_nade.nade_time_primed); makevectors(player.angles); held_nade.velocity = player.velocity; setorigin(held_nade, player.origin + player.view_ofs + v_forward * 8 + v_right * -8 + v_up * 0); @@ -1351,7 +1351,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn) if(player.nade_spawnloc.cnt <= 0) { - remove(player.nade_spawnloc); + delete(player.nade_spawnloc); player.nade_spawnloc = NULL; } } @@ -1429,7 +1429,7 @@ MUTATOR_HOOKFUNCTION(nades, MonsterDies) MUTATOR_HOOKFUNCTION(nades, DropSpecialItems) { entity frag_target = M_ARGV(0, entity); - + if(frag_target.nade) toss_nade(frag_target, true, '0 0 0', time + 0.05); }