mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Use correct formula for bullet hitscan
This commit is contained in:
parent
d85c5d8dd8
commit
c2f30de350
3 changed files with 11 additions and 2 deletions
|
@ -382,7 +382,12 @@ MOVEEND:
|
|||
{
|
||||
vec3_t startPos = { x, y, z };
|
||||
hitdata_t hitData;
|
||||
hitscan(&startPos, pSprite->sectnum, Cos(pSprite->ang), Sin(pSprite->ang), (-Sin(pBullet->field_C)) << 3, &hitData, CLIPMASK1);
|
||||
int dz;
|
||||
if (bVanilla)
|
||||
dz = -Sin(pBullet->field_C) * 8;
|
||||
else
|
||||
dz = -pBullet->field_C * 512;
|
||||
hitscan(&startPos, pSprite->sectnum, Cos(pSprite->ang), Sin(pSprite->ang), dz, &hitData, CLIPMASK1);
|
||||
x2 = hitData.pos.x;
|
||||
y2 = hitData.pos.y;
|
||||
z2 = hitData.pos.z;
|
||||
|
@ -633,7 +638,7 @@ int BuildBullet(short nSprite, int nType, int ebx, int ecx, int val1, int nAngle
|
|||
sprite[nBulletSprite].cstat |= 0x8000;
|
||||
}
|
||||
|
||||
pBullet->field_C = val2 & 0x7FF; // TODO - anglemask?
|
||||
pBullet->field_C = val2;
|
||||
pBullet->nType = nType;
|
||||
pBullet->nSprite = nBulletSprite;
|
||||
pBullet->field_6 = runlist_AddRunRec(sprite[nBulletSprite].lotag - 1, nBullet | 0xB0000);
|
||||
|
|
|
@ -628,6 +628,8 @@ short scan_char = 0;
|
|||
int nStartLevel;
|
||||
int nTimeLimit;
|
||||
|
||||
int bVanilla = 0;
|
||||
|
||||
char debugBuffer[256];
|
||||
|
||||
short wConsoleNode; // TODO - move me into network file
|
||||
|
|
|
@ -184,6 +184,8 @@ extern const char *gString[];
|
|||
|
||||
extern short bNoSound;
|
||||
|
||||
extern int bVanilla;
|
||||
|
||||
extern char g_modDir[BMAX_PATH];
|
||||
enum {
|
||||
kPalNormal = 0,
|
||||
|
|
Loading…
Reference in a new issue