Minor cleanups in actors.c, mostly relating to custom projectiles and the like. A bug causing custom projectiles to knock the player back twice as far as the hard-coded ones was also fixed. There should be no other functional changes for the end user.

git-svn-id: https://svn.eduke32.com/eduke32@3053 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2012-10-05 20:48:10 +00:00
parent f8480d00f9
commit 9120696e86
6 changed files with 633 additions and 713 deletions

File diff suppressed because it is too large Load diff

View file

@ -92,7 +92,7 @@ typedef struct {
int16_t extra, extra_rand; // 4b
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat; // 4b
int8_t shade, xrepeat, yrepeat, pal; // 4b
int8_t velmult; // 1b
int8_t movecnt; // 1b
uint8_t clipdist; // 1b
int8_t filler[6]; // 6b
} projectile_t;

View file

@ -386,6 +386,8 @@ enum {
SE_34 = 34, // XXX
SE_35 = 35, // XXX
SE_36_PROJ_SHOOTER = 36,
SE_49_POINT_LIGHT = 49,
SE_50_SPOT_LIGHT = 50,
};
// sector lotags

View file

@ -999,7 +999,7 @@ const memberlabel_t ProjectileLabels[]=
{ "pal", PROJ_PAL, 0, 0 },
{ "extra_rand", PROJ_EXTRA_RAND, 0, 0 },
{ "hitradius", PROJ_HITRADIUS, 0, 0 },
{ "velmult", PROJ_VEL_MULT, 0, 0 },
{ "velmult", PROJ_MOVECNT, 0, 0 },
{ "offset", PROJ_OFFSET, 0, 0 },
{ "bounces", PROJ_BOUNCES, 0, 0 },
{ "bsound", PROJ_BSOUND, 0, 0 },
@ -4057,8 +4057,8 @@ static int32_t C_ParseCommand(int32_t loop)
DefaultProjectileData[j].extra_rand = ProjectileData[j].extra_rand = z; break;
case PROJ_HITRADIUS:
DefaultProjectileData[j].hitradius = ProjectileData[j].hitradius = z; break;
case PROJ_VEL_MULT:
DefaultProjectileData[j].velmult = ProjectileData[j].velmult = z; break;
case PROJ_MOVECNT:
DefaultProjectileData[j].movecnt = ProjectileData[j].movecnt = z; break;
case PROJ_OFFSET:
DefaultProjectileData[j].offset = ProjectileData[j].offset = z; break;
case PROJ_BOUNCES:
@ -5731,7 +5731,7 @@ static void C_AddDefaultDefinitions(void)
C_AddDefinition("PROJ_TRAIL",PROJ_TRAIL,LABEL_DEFINE);
C_AddDefinition("PROJ_TXREPEAT",PROJ_TXREPEAT,LABEL_DEFINE);
C_AddDefinition("PROJ_TYREPEAT",PROJ_TYREPEAT,LABEL_DEFINE);
C_AddDefinition("PROJ_VEL_MULT",PROJ_VEL_MULT,LABEL_DEFINE);
C_AddDefinition("PROJ_VEL_MULT",PROJ_MOVECNT,LABEL_DEFINE);
C_AddDefinition("PROJ_VEL",PROJ_VEL,LABEL_DEFINE);
C_AddDefinition("PROJ_WORKSLIKE",PROJ_WORKSLIKE,LABEL_DEFINE);
C_AddDefinition("PROJ_XREPEAT",PROJ_XREPEAT,LABEL_DEFINE);
@ -5754,7 +5754,7 @@ static void C_InitProjectiles(void)
int16_t extra, extra_rand; // 4b
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat; // 4b
int8_t shade, xrepeat, yrepeat, pal; // 4b
int8_t velmult; // 1b
int8_t movecnt; // 1b
uint8_t clipdist; // 1b
int8_t filler[6]; // 6b
} defaultprojectile_t;

View file

@ -568,7 +568,7 @@ enum ProjectileLabel_t
PROJ_PAL, // 20
PROJ_EXTRA_RAND,
PROJ_HITRADIUS,
PROJ_VEL_MULT,
PROJ_MOVECNT,
PROJ_OFFSET,
PROJ_BOUNCES, // 25
PROJ_BSOUND,

View file

@ -1140,13 +1140,13 @@ static void __fastcall VM_AccessActiveProjectile(int32_t iSet, int32_t lVar1, in
Gv_SetVarX(lVar2, SpriteProjectile[proj].hitradius);
return;
case PROJ_VEL_MULT:
case PROJ_MOVECNT:
if (iSet)
{
SpriteProjectile[proj].velmult=lValue;
SpriteProjectile[proj].movecnt=lValue;
return;
}
Gv_SetVarX(lVar2, SpriteProjectile[proj].velmult);
Gv_SetVarX(lVar2, SpriteProjectile[proj].movecnt);
return;
case PROJ_OFFSET:
@ -3330,13 +3330,13 @@ static void __fastcall VM_AccessProjectile(int32_t iSet, int32_t lVar1, int32_t
Gv_SetVarX(lVar2, ProjectileData[lVar1].hitradius);
return;
case PROJ_VEL_MULT:
case PROJ_MOVECNT:
if (iSet)
{
ProjectileData[lVar1].velmult=lValue;
ProjectileData[lVar1].movecnt=lValue;
return;
}
Gv_SetVarX(lVar2, ProjectileData[lVar1].velmult);
Gv_SetVarX(lVar2, ProjectileData[lVar1].movecnt);
return;
case PROJ_OFFSET: