33 gi.SetAreaPortalState(ent->style, ent->count);
60 v[2] = 200.0 + 100.0 *
random();
63 VectorScale(v, 0.7, v);
65 VectorScale(v, 1.2, v);
70 if (ent->velocity[0] < -300)
71 ent->velocity[0] = -300;
72 else if (ent->velocity[0] > 300)
73 ent->velocity[0] = 300;
74 if (ent->velocity[1] < -300)
75 ent->velocity[1] = -300;
76 else if (ent->velocity[1] > 300)
77 ent->velocity[1] = 300;
78 if (ent->velocity[2] < 200)
79 ent->velocity[2] = 200;
80 else if (ent->velocity[2] > 500)
81 ent->velocity[2] = 500;
95 if (self->s.frame == 10) {
103 vec3_t normal_angles,
right;
105 if (!self->groundentity)
111 gi.sound(
self, CHAN_VOICE,
gi.soundindex(
"misc/fhit3.wav"), 1, ATTN_NORM, 0);
125 void gib_die(edict_t *
self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point)
130 void ThrowGib(edict_t *
self,
char *gibname,
int damage,
int type)
140 VectorScale(self->size, 0.5, size);
141 VectorAdd(self->absmin, size,
origin);
146 gi.setmodel(gib, gibname);
147 gib->solid = SOLID_NOT;
148 gib->s.effects |= EF_GIB;
163 VectorMA(self->velocity, vscale, vd, gib->velocity);
165 gib->avelocity[0] =
random() * 600;
166 gib->avelocity[1] =
random() * 600;
167 gib->avelocity[2] =
random() * 600;
175 void ThrowHead(edict_t *
self,
char *gibname,
int damage,
int type)
182 VectorClear(self->mins);
183 VectorClear(self->maxs);
185 self->s.modelindex2 = 0;
186 gi.setmodel(
self, gibname);
187 self->solid = SOLID_NOT;
188 self->s.effects |= EF_GIB;
189 self->s.effects &= ~EF_FLIES;
192 self->svflags &= ~SVF_MONSTER;
206 VectorMA(self->velocity, vscale, vd, self->velocity);
209 self->avelocity[YAW] =
crandom() * 600;
224 gibname =
"models/objects/gibs/head2/tris.md2";
227 gibname =
"models/objects/gibs/skull/tris.md2";
231 self->s.origin[2] += 32;
233 gi.setmodel(
self, gibname);
234 VectorSet(self->mins, -16, -16, 0);
235 VectorSet(self->maxs, 16, 16, 16);
238 self->solid = SOLID_NOT;
239 self->s.effects = EF_GIB;
245 VectorAdd(self->velocity, vd, self->velocity);
249 self->client->anim_end =
self->s.frame;
264 void debris_die(edict_t *
self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point)
275 VectorCopy(
origin, chunk->s.origin);
276 gi.setmodel(chunk, modelname);
280 VectorMA(self->velocity, speed, v, chunk->velocity);
282 chunk->solid = SOLID_NOT;
283 chunk->avelocity[0] =
random() * 600;
284 chunk->avelocity[1] =
random() * 600;
285 chunk->avelocity[2] =
random() * 600;
290 chunk->classname =
"debris";
293 gi.linkentity(chunk);
300 gi.WriteByte(TE_EXPLOSION1);
301 gi.WritePosition(self->s.origin);
302 gi.multicast(self->s.origin, MULTICAST_PVS);
311 gi.WriteByte(TE_EXPLOSION2);
312 gi.WritePosition(self->s.origin);
313 gi.multicast(self->s.origin, MULTICAST_PVS);
330 if (
other->movetarget !=
self)
336 if (self->pathtarget) {
339 savetarget =
self->target;
340 self->target =
self->pathtarget;
342 self->target = savetarget;
350 if ((next) && (next->spawnflags & 1)) {
351 VectorCopy(next->s.origin, v);
352 v[2] += next->mins[2];
353 v[2] -=
other->mins[2];
354 VectorCopy(v,
other->s.origin);
356 other->s.event = EV_OTHER_TELEPORT;
367 if (!
other->movetarget) {
371 VectorSubtract(
other->goalentity->s.origin,
other->s.origin, v);
378 if (!self->targetname) {
379 gi.dprintf(
"path_corner with no targetname at %s\n",
vtos(self->s.origin));
384 self->solid = SOLID_TRIGGER;
386 VectorSet(self->mins, -8, -8, -8);
387 VectorSet(self->maxs, 8, 8, 8);
388 self->svflags |= SVF_NOCLIENT;
402 if (
other->movetarget !=
self)
406 other->target =
self->target;
408 if (!
other->goalentity) {
409 gi.dprintf(
"%s at %s target %s does not exist\n", self->classname,
vtos(self->s.origin), self->target);
410 other->movetarget =
self;
419 if (
other->movetarget ==
self) {
420 other->target = NULL;
421 other->movetarget = NULL;
426 if (self->pathtarget) {
429 savetarget =
self->target;
430 self->target =
self->pathtarget;
432 activator =
other->enemy;
433 else if (
other->oldenemy &&
other->oldenemy->client)
434 activator =
other->oldenemy;
435 else if (
other->activator &&
other->activator->client)
436 activator =
other->activator;
440 self->target = savetarget;
450 self->solid = SOLID_TRIGGER;
452 VectorSet(self->mins, -8, -8, -16);
453 VectorSet(self->maxs, 8, 8, 16);
454 self->svflags = SVF_NOCLIENT;
464 ent->s.frame = (ent->s.frame + 1) % 7;
470 gi.dprintf(
"viewthing spawned\n");
473 ent->solid = SOLID_BBOX;
474 ent->s.renderfx = RF_FRAMELERP;
475 VectorSet(ent->mins, -16, -16, -24);
476 VectorSet(ent->maxs, 16, 16, 32);
477 ent->s.modelindex =
gi.modelindex(
"models/objects/banner/tris.md2");
499 VectorCopy(self->s.origin, self->absmin);
500 VectorCopy(self->s.origin, self->absmax);
517 gi.configstring(CS_LIGHTS + self->style,
"m");
520 gi.configstring(CS_LIGHTS + self->style,
"a");
533 if (self->style >= 32) {
536 gi.configstring(CS_LIGHTS + self->style,
"a");
538 gi.configstring(CS_LIGHTS + self->style,
"m");
559 if (self->solid == SOLID_NOT) {
560 self->solid = SOLID_BSP;
561 self->svflags &= ~SVF_NOCLIENT;
564 self->solid = SOLID_NOT;
565 self->svflags |= SVF_NOCLIENT;
569 if (!(self->spawnflags & 2))
576 gi.setmodel(
self, self->model);
578 if (self->spawnflags & 8)
579 self->s.effects |= EF_ANIM_ALL;
580 if (self->spawnflags & 16)
581 self->s.effects |= EF_ANIM_ALLFAST;
584 if ((self->spawnflags & 7) == 0) {
585 self->solid = SOLID_BSP;
591 if (!(self->spawnflags & 1)) {
593 self->spawnflags |= 1;
597 if (self->spawnflags & 4) {
598 if (!(self->spawnflags & 2)) {
599 gi.dprintf(
"func_wall START_ON without TOGGLE\n");
600 self->spawnflags |= 2;
605 if (self->spawnflags & 4) {
606 self->solid = SOLID_BSP;
608 self->solid = SOLID_NOT;
609 self->svflags |= SVF_NOCLIENT;
624 if (plane->normal[2] < 1.0)
639 self->solid = SOLID_BSP;
640 self->svflags &= ~SVF_NOCLIENT;
648 gi.setmodel(
self, self->model);
660 if (self->spawnflags == 0) {
661 self->solid = SOLID_BSP;
666 self->solid = SOLID_NOT;
669 self->svflags |= SVF_NOCLIENT;
672 if (self->spawnflags & 2)
673 self->s.effects |= EF_ANIM_ALL;
674 if (self->spawnflags & 4)
675 self->s.effects |= EF_ANIM_ALLFAST;
677 self->clipmask = MASK_MONSTERSOLID;
705 VectorScale(self->size, 0.5, size);
706 VectorAdd(self->absmin, size,
origin);
707 VectorCopy(
origin, self->s.origin);
714 VectorSubtract(self->s.origin, inflictor->s.origin, self->velocity);
716 VectorScale(self->velocity, 150, self->velocity);
719 VectorScale(size, 0.5, size);
734 ThrowDebris(
self,
"models/objects/debris1/tris.md2", 1, chunkorigin);
746 ThrowDebris(
self,
"models/objects/debris2/tris.md2", 2, chunkorigin);
764 self->solid = SOLID_BSP;
765 self->svflags &= ~SVF_NOCLIENT;
781 gi.modelindex(
"models/objects/debris1/tris.md2");
782 gi.modelindex(
"models/objects/debris2/tris.md2");
784 gi.setmodel(
self, self->model);
786 if (self->spawnflags & 1) {
787 self->svflags |= SVF_NOCLIENT;
788 self->solid = SOLID_NOT;
791 self->solid = SOLID_BSP;
792 if (self->targetname)
796 if (self->spawnflags & 2)
797 self->s.effects |= EF_ANIM_ALL;
798 if (self->spawnflags & 4)
799 self->s.effects |= EF_ANIM_ALLFAST;
823 if ((!
other->groundentity) || (
other->groundentity ==
self))
826 ratio = (float)
other->mass / (
float)
self->mass;
827 VectorSubtract(self->s.origin,
other->s.origin, v);
839 VectorCopy(self->s.origin, save);
840 VectorMA(self->absmin, 0.5, self->size, self->s.origin);
843 spd = 1.5 * (float)self->dmg / 200.0;
844 org[0] = self->s.origin[0] +
crandom() *
self->size[0];
845 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
846 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
847 ThrowDebris(
self,
"models/objects/debris1/tris.md2", spd, org);
848 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
849 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
850 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
851 ThrowDebris(
self,
"models/objects/debris1/tris.md2", spd, org);
854 spd = 1.75 * (float)self->dmg / 200.0;
855 VectorCopy(self->absmin, org);
856 ThrowDebris(
self,
"models/objects/debris3/tris.md2", spd, org);
857 VectorCopy(self->absmin, org);
858 org[0] +=
self->size[0];
859 ThrowDebris(
self,
"models/objects/debris3/tris.md2", spd, org);
860 VectorCopy(self->absmin, org);
861 org[1] +=
self->size[1];
862 ThrowDebris(
self,
"models/objects/debris3/tris.md2", spd, org);
863 VectorCopy(self->absmin, org);
864 org[0] +=
self->size[0];
865 org[1] +=
self->size[1];
866 ThrowDebris(
self,
"models/objects/debris3/tris.md2", spd, org);
869 spd = 2 *
self->dmg / 200;
870 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
871 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
872 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
873 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
874 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
875 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
876 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
877 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
878 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
879 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
880 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
881 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
882 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
883 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
884 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
885 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
886 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
887 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
888 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
889 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
890 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
891 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
892 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
893 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
894 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
895 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
896 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
897 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
898 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
899 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
900 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
901 ThrowDebris(
self,
"models/objects/debris2/tris.md2", spd, org);
903 VectorCopy(save, self->s.origin);
904 if (self->groundentity)
910 void barrel_delay(edict_t *
self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point)
915 self->activator = attacker;
926 gi.modelindex(
"models/objects/debris1/tris.md2");
927 gi.modelindex(
"models/objects/debris2/tris.md2");
928 gi.modelindex(
"models/objects/debris3/tris.md2");
930 self->solid = SOLID_BBOX;
933 self->model =
"models/objects/barrels/tris.md2";
934 self->s.modelindex =
gi.modelindex(self->model);
935 VectorSet(self->mins, -16, -16, 0);
936 VectorSet(self->maxs, 16, 16, 40);
978 if (++self->s.frame < 19)
989 ent->solid = SOLID_NOT;
990 VectorSet(ent->mins, -64, -64, 0);
991 VectorSet(ent->maxs, 64, 64, 8);
992 ent->s.modelindex =
gi.modelindex(
"models/objects/black/tris.md2");
993 ent->s.renderfx = RF_TRANSLUCENT;
1005 if (++self->s.frame < 293)
1008 self->s.frame = 254;
1016 ent->solid = SOLID_BBOX;
1017 VectorSet(ent->mins, -32, -32, -16);
1018 VectorSet(ent->maxs, 32, 32, 32);
1019 ent->s.modelindex =
gi.modelindex(
"models/monsters/tank/tris.md2");
1032 if (++self->s.frame < 247)
1035 self->s.frame = 208;
1043 ent->solid = SOLID_BBOX;
1044 VectorSet(ent->mins, -32, -32, 0);
1045 VectorSet(ent->maxs, 32, 32, 32);
1046 ent->s.modelindex =
gi.modelindex(
"models/monsters/bitch/tris.md2");
1059 if (++self->s.frame < 287)
1062 self->s.frame = 248;
1070 ent->solid = SOLID_BBOX;
1071 VectorSet(ent->mins, -32, -32, 0);
1072 VectorSet(ent->maxs, 32, 32, 32);
1073 ent->s.modelindex =
gi.modelindex(
"models/monsters/bitch/tris.md2");
1088 if (++self->s.frame < 24)
1091 self->nextthink = 0;
1093 if (self->s.frame == 22)
1094 gi.sound(
self, CHAN_BODY,
gi.soundindex(
"tank/thud.wav"), 1, ATTN_NORM, 0);
1101 gi.sound(
self, CHAN_BODY,
gi.soundindex(
"tank/pain.wav"), 1, ATTN_NORM, 0);
1107 self->s.origin[2] += 2;
1113 self->solid = SOLID_BBOX;
1114 self->model =
"models/monsters/commandr/tris.md2";
1115 self->s.modelindex =
gi.modelindex(self->model);
1116 VectorSet(self->mins, -32, -32, 0);
1117 VectorSet(self->maxs, 32, 32, 48);
1121 self->s.renderfx |= RF_FRAMELERP;
1122 gi.linkentity(
self);
1124 gi.soundindex(
"tank/thud.wav");
1125 gi.soundindex(
"tank/pain.wav");
1138 ent->s.frame = (ent->s.frame + 1) % 16;
1145 ent->solid = SOLID_NOT;
1146 ent->s.modelindex =
gi.modelindex(
"models/objects/banner/tris.md2");
1147 ent->s.frame = rand() % 16;
1161 if (self->health > -80)
1164 gi.sound(
self, CHAN_BODY,
gi.soundindex(
"misc/udeath.wav"), 1, ATTN_NORM, 0);
1165 for (n = 0; n < 4; n++)
1179 ent->solid = SOLID_BBOX;
1180 ent->s.modelindex =
gi.modelindex(
"models/deadbods/dude/tris.md2");
1183 if (ent->spawnflags & 2)
1185 else if (ent->spawnflags & 4)
1187 else if (ent->spawnflags & 8)
1189 else if (ent->spawnflags & 16)
1191 else if (ent->spawnflags & 32)
1196 VectorSet(ent->mins, -16, -16, 0);
1197 VectorSet(ent->maxs, 16, 16, 16);
1200 ent->svflags |= SVF_MONSTER | SVF_DEADMONSTER;
1215 extern void train_use(edict_t *
self, edict_t *
other, edict_t *activator);
1220 self->svflags &= ~SVF_NOCLIENT;
1228 gi.dprintf(
"misc_viper without a target at %s\n",
vtos(ent->absmin));
1237 ent->solid = SOLID_NOT;
1238 ent->s.modelindex =
gi.modelindex(
"models/ships/viper/tris.md2");
1239 VectorSet(ent->mins, -16, -16, 0);
1240 VectorSet(ent->maxs, 16, 16, 32);
1245 ent->svflags |= SVF_NOCLIENT;
1246 ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
1258 ent->solid = SOLID_BBOX;
1259 VectorSet(ent->mins, -176, -120, -24);
1260 VectorSet(ent->maxs, 176, 120, 72);
1261 ent->s.modelindex =
gi.modelindex(
"models/ships/bigviper/tris.md2");
1273 self->s.origin[2] =
self->absmin[2] + 1;
1283 self->groundentity = NULL;
1289 VectorScale(self->moveinfo.dir, 1.0 +
diff, v);
1292 diff =
self->s.angles[2];
1294 self->s.angles[2] =
diff + 10;
1301 self->solid = SOLID_BBOX;
1302 self->svflags &= ~SVF_NOCLIENT;
1303 self->s.effects |= EF_ROCKET;
1308 self->activator = activator;
1310 viper =
G_Find(NULL,
FOFS(classname),
"misc_viper");
1311 VectorScale(viper->moveinfo.dir, viper->moveinfo.speed, self->velocity);
1314 VectorCopy(viper->moveinfo.dir, self->moveinfo.dir);
1320 self->solid = SOLID_NOT;
1321 VectorSet(self->mins, -8, -8, -8);
1322 VectorSet(self->maxs, 8, 8, 8);
1324 self->s.modelindex =
gi.modelindex(
"models/objects/bomb/tris.md2");
1330 self->svflags |= SVF_NOCLIENT;
1332 gi.linkentity(
self);
1344 extern void train_use(edict_t *
self, edict_t *
other, edict_t *activator);
1349 self->svflags &= ~SVF_NOCLIENT;
1357 gi.dprintf(
"%s without a target at %s\n", ent->classname,
vtos(ent->absmin));
1366 ent->solid = SOLID_NOT;
1367 ent->s.modelindex =
gi.modelindex(
"models/ships/strogg1/tris.md2");
1368 VectorSet(ent->mins, -16, -16, 0);
1369 VectorSet(ent->maxs, 16, 16, 32);
1374 ent->svflags |= SVF_NOCLIENT;
1375 ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
1386 if (self->s.frame < 38)
1400 ent->solid = SOLID_BBOX;
1401 VectorSet(ent->mins, -64, -64, 0);
1402 VectorSet(ent->maxs, 64, 64, 128);
1403 ent->s.modelindex =
gi.modelindex(
"models/objects/satellite/tris.md2");
1414 ent->solid = SOLID_BBOX;
1415 ent->s.modelindex =
gi.modelindex(
"models/objects/minelite/light1/tris.md2");
1425 ent->solid = SOLID_BBOX;
1426 ent->s.modelindex =
gi.modelindex(
"models/objects/minelite/light2/tris.md2");
1436 gi.setmodel(ent,
"models/objects/gibs/arm/tris.md2");
1437 ent->solid = SOLID_NOT;
1438 ent->s.effects |= EF_GIB;
1442 ent->svflags |= SVF_MONSTER;
1444 ent->avelocity[0] =
random() * 200;
1445 ent->avelocity[1] =
random() * 200;
1446 ent->avelocity[2] =
random() * 200;
1457 gi.setmodel(ent,
"models/objects/gibs/leg/tris.md2");
1458 ent->solid = SOLID_NOT;
1459 ent->s.effects |= EF_GIB;
1463 ent->svflags |= SVF_MONSTER;
1465 ent->avelocity[0] =
random() * 200;
1466 ent->avelocity[1] =
random() * 200;
1467 ent->avelocity[2] =
random() * 200;
1478 gi.setmodel(ent,
"models/objects/gibs/head/tris.md2");
1479 ent->solid = SOLID_NOT;
1480 ent->s.effects |= EF_GIB;
1484 ent->svflags |= SVF_MONSTER;
1486 ent->avelocity[0] =
random() * 200;
1487 ent->avelocity[1] =
random() * 200;
1488 ent->avelocity[2] =
random() * 200;
1504 gi.setmodel(
self, self->model);
1505 self->solid = SOLID_BSP;
1507 gi.linkentity(
self);
1521 l = strlen(self->message);
1522 for (e = self->teammaster; e; e = e->teamchain) {
1531 c =
self->message[n];
1532 if (
c >=
'0' &&
c <=
'9')
1533 e->s.frame =
c -
'0';
1566 self->activator = NULL;
1567 if (self->spawnflags & 1) {
1569 self->wait =
self->count;
1570 }
else if (self->spawnflags & 2) {
1571 self->health =
self->count;
1578 if (self->style == 0) {
1583 if (self->style == 1) {
1585 if (self->message[3] ==
' ')
1586 self->message[3] =
'0';
1590 if (self->style == 2) {
1591 Q_snprintf(self->message,
CLOCK_MESSAGE_SIZE,
"%2i:%2i:%2i", self->health / 3600, (self->health - (self->health / 3600) * 3600) / 60, self->health % 60);
1592 if (self->message[3] ==
' ')
1593 self->message[3] =
'0';
1594 if (self->message[6] ==
' ')
1595 self->message[6] =
'0';
1603 self->enemy =
G_Find(NULL,
FOFS(targetname), self->target);
1608 if (self->spawnflags & 1) {
1611 }
else if (self->spawnflags & 2) {
1618 gmtime = time(NULL);
1619 ltime = localtime(&gmtime);
1623 strcpy(self->message,
"00:00:00");
1624 if (self->message[3] ==
' ')
1625 self->message[3] =
'0';
1626 if (self->message[6] ==
' ')
1627 self->message[6] =
'0';
1630 self->enemy->message =
self->message;
1631 self->enemy->use(self->enemy,
self,
self);
1633 if (((self->spawnflags & 1) && (self->health > self->wait)) ||
1634 ((self->spawnflags & 2) && (self->health < self->wait))) {
1635 if (self->pathtarget) {
1639 savetarget =
self->target;
1640 savemessage =
self->message;
1641 self->target =
self->pathtarget;
1642 self->message = NULL;
1644 self->target = savetarget;
1645 self->message = savemessage;
1648 if (!(self->spawnflags & 8))
1653 if (self->spawnflags & 4)
1662 if (!(self->spawnflags & 8))
1664 if (self->activator)
1666 self->activator = activator;
1672 if (!self->target) {
1673 gi.dprintf(
"%s with no target at %s\n", self->classname,
vtos(self->s.origin));
1678 if ((self->spawnflags & 2) && (!self->count)) {
1679 gi.dprintf(
"%s with no count at %s\n", self->classname,
vtos(self->s.origin));
1684 if ((self->spawnflags & 1) && (!self->count))
1685 self->count = 60 * 60;;
1693 if (self->spawnflags & 4)
1708 dest =
G_Find(NULL,
FOFS(targetname), self->target);
1710 gi.dprintf(
"Couldn't find destination\n");
1717 VectorCopy(dest->s.origin,
other->s.origin);
1718 VectorCopy(dest->s.origin,
other->s.old_origin);
1719 other->s.origin[2] += 10;
1722 VectorClear(
other->velocity);
1723 other->client->ps.pmove.pm_time = 160 >> 3;
1724 other->client->ps.pmove.pm_flags |= PMF_TIME_TELEPORT;
1727 self->owner->s.event = EV_PLAYER_TELEPORT;
1728 other->s.event = EV_PLAYER_TELEPORT;
1731 for (i = 0 ; i < 3 ; i++) {
1732 other->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(dest->s.angles[i] -
other->client->resp.cmd_angles[i]);
1735 VectorClear(
other->s.angles);
1736 VectorClear(
other->client->ps.viewangles);
1737 VectorClear(
other->client->v_angle);
1753 gi.dprintf(
"teleporter without a target.\n");
1758 gi.setmodel(ent,
"models/objects/dmspot/tris.md2");
1760 ent->s.effects = EF_TELEPORTER;
1761 ent->s.sound =
gi.soundindex(
"world/amb10.wav");
1762 ent->solid = SOLID_BBOX;
1764 VectorSet(ent->mins, -32, -32, -24);
1765 VectorSet(ent->maxs, 32, 32, -16);
1770 trig->solid = SOLID_TRIGGER;
1771 trig->target = ent->target;
1773 VectorCopy(ent->s.origin, trig->s.origin);
1774 VectorSet(trig->mins, -8, -8, 8);
1775 VectorSet(trig->maxs, 8, 8, 24);
1776 gi.linkentity(trig);
1785 gi.setmodel(ent,
"models/objects/dmspot/tris.md2");
1787 ent->solid = SOLID_BBOX;
1789 VectorSet(ent->mins, -32, -32, -24);
1790 VectorSet(ent->maxs, 32, 32, -16);