Projectile changes:

-palette is now set at spawn time, instead of during movement (oops!)
-projectiles can no longer hit their owner during their first tic of movement

git-svn-id: https://svn.eduke32.com/eduke32@5498 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2015-12-28 02:04:41 +00:00
parent 935e9fa197
commit 0871e56b92
3 changed files with 18 additions and 6 deletions

View file

@ -2677,14 +2677,14 @@ static int32_t Proj_MaybeDamageCF(const spritetype *s)
ACTOR_STATIC void Proj_MoveCustom(int32_t i) ACTOR_STATIC void Proj_MoveCustom(int32_t i)
{ {
int const m = SpriteProjectile[i].workslike & PROJECTILE_MOVED;
SpriteProjectile[i].workslike |= PROJECTILE_MOVED;
const projectile_t *const proj = &SpriteProjectile[i]; const projectile_t *const proj = &SpriteProjectile[i];
spritetype *const s = &sprite[i]; spritetype *const s = &sprite[i];
vec3_t davect; vec3_t davect;
int32_t j=0; int32_t j=0;
if (proj->pal >= 0)
s->pal = proj->pal;
switch (proj->workslike & PROJECTILE_TYPE_MASK) switch (proj->workslike & PROJECTILE_TYPE_MASK)
{ {
case PROJECTILE_HITSCAN: case PROJECTILE_HITSCAN:
@ -2727,9 +2727,7 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
if (proj->trail >= 0) if (proj->trail >= 0)
{ {
int32_t cnt; for (int cnt=0; cnt<=proj->tnum; cnt++)
for (cnt=0; cnt<=proj->tnum; cnt++)
{ {
j = A_Spawn(i, proj->trail); j = A_Spawn(i, proj->trail);
@ -2754,6 +2752,14 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
ll >>= 1; ll >>= 1;
} }
uint16_t cst = 0;
if (!m && (unsigned) s->owner < MAXSPRITES)
{
cst = sprite[s->owner].cstat;
sprite[s->owner].cstat &= ~CSTAT_SPRITE_BLOCK;
}
do do
{ {
vec3_t tmpvect; vec3_t tmpvect;
@ -2765,6 +2771,8 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
j = A_MoveSprite(i, &tmpvect, CLIPMASK1); j = A_MoveSprite(i, &tmpvect, CLIPMASK1);
} while (!j && --cnt > 0); } while (!j && --cnt > 0);
if (cst) sprite[s->owner].cstat = cst;
} }
if (!(proj->workslike & PROJECTILE_BOUNCESOFFWALLS) && // NOT_BOUNCESOFFWALLS_YVEL if (!(proj->workslike & PROJECTILE_BOUNCESOFFWALLS) && // NOT_BOUNCESOFFWALLS_YVEL

View file

@ -285,6 +285,7 @@ enum pflags_t {
PROJECTILE_REALCLIPDIST = 0x00080000, PROJECTILE_REALCLIPDIST = 0x00080000,
PROJECTILE_ACCURATE = 0x00100000, PROJECTILE_ACCURATE = 0x00100000,
PROJECTILE_NOSETOWNERSHADE = 0x00200000, PROJECTILE_NOSETOWNERSHADE = 0x00200000,
PROJECTILE_MOVED = 0x80000000, // internal flag, do not document
PROJECTILE_TYPE_MASK = PROJECTILE_HITSCAN|PROJECTILE_RPG|PROJECTILE_KNEE|PROJECTILE_BLOOD, PROJECTILE_TYPE_MASK = PROJECTILE_HITSCAN|PROJECTILE_RPG|PROJECTILE_KNEE|PROJECTILE_BLOOD,
}; };

View file

@ -978,6 +978,9 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa,
sprite[j].xrepeat = proj->xrepeat; sprite[j].xrepeat = proj->xrepeat;
sprite[j].yrepeat = proj->yrepeat; sprite[j].yrepeat = proj->yrepeat;
if (proj->pal >= 0)
sprite[j].pal = proj->pal;
if (proj->extra_rand > 0) if (proj->extra_rand > 0)
sprite[j].extra += (krand()&proj->extra_rand); sprite[j].extra += (krand()&proj->extra_rand);