Missiles are now destroiable

This commit is contained in:
q3rally 2015-11-13 22:35:22 +00:00
parent f6393c97a2
commit e3dadb71c2
2 changed files with 34 additions and 24 deletions

View file

@ -222,6 +222,23 @@ void G_ExplodeMissile( gentity_t *ent ) {
//Q3Rally Code Start
/*
================
G_MissileDie
Destroy a missile
================
*/
void G_MissileDie( gentity_t *self, gentity_t *inflictor,
gentity_t *attacker, int damage, int mod ) {
if (inflictor == self)
return;
self->takedamage = qfalse;
self->think = G_ExplodeMissile;
self->nextthink = level.time + 10;
}
/*
=================
fire_flame
@ -500,7 +517,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
G_AddEvent( ent, EV_GRENADE_BOUNCE, 0 );
return;
}
ent->takedamage = qfalse;
#ifdef MISSIONPACK
if ( other->takedamage ) {
if ( ent->s.weapon != WP_PROX_LAUNCHER ) {
@ -1028,6 +1046,14 @@ gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir) {
bolt->classname = "rocket";
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->health = 5;
bolt->takedamage = qtrue;
bolt->die = G_MissileDie;
bolt->r.contents = CONTENTS_BODY;
VectorSet(bolt->r.mins, -10, -3, 0);
VectorCopy(bolt->r.mins, bolt->r.absmin);
VectorSet(bolt->r.maxs, 10, 3, 6);
VectorCopy(bolt->r.maxs, bolt->r.absmax);
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_ROCKET_LAUNCHER;

View file

@ -164,7 +164,7 @@ q3rallycode
engine\code\client\snd_openal.c
engine\code\client\snd_public.h
engine\code\client\snd_wavelet.c
-game
+game
engine\code\game\ai_chat.c
engine\code\game\ai_chat.h
engine\code\game\ai_cmd.c
@ -485,7 +485,7 @@ q3rallycode
engine\code\q3_ui\ui_team.c
engine\code\q3_ui\ui_teamorders.c
engine\code\q3_ui\ui_video.c
+qcommon
-qcommon
engine\code\qcommon\cm_load.c
engine\code\qcommon\cm_local.h
engine\code\qcommon\cm_patch.c
@ -856,26 +856,10 @@ q3rallycode
engine\voip-readme.txt
engine\resync_svn.sh
[Open project files]
0=engine\code\cgame\cg_draw.c
1=engine\code\cgame\cg_local.h
2=engine\code\cgame\cg_main.c
3=engine\code\cgame\cg_rally_hud.c
4=engine\code\cgame\cg_view.c
0=engine\code\game\g_missile.c
[Selected Project Files]
Main=
Selected=engine\code\cgame\cg_view.c
[engine\code\cgame\cg_draw.c]
TopLine=3340
Caret=4,3358
[engine\code\cgame\cg_local.h]
TopLine=1931
Caret=4,1953
[engine\code\cgame\cg_main.c]
TopLine=1038
Caret=3,1056
[engine\code\cgame\cg_rally_hud.c]
TopLine=201
Caret=1,185
[engine\code\cgame\cg_view.c]
TopLine=832
Caret=3,821
Selected=engine\code\game\g_missile.c
[engine\code\game\g_missile.c]
TopLine=171
Caret=1,177