Remove pointless code from chrTick

This commit is contained in:
Ryan Dwyer 2022-11-15 22:33:51 +10:00
parent e4e4074352
commit 2823263f29
4 changed files with 8 additions and 41 deletions

View File

@ -55,10 +55,7 @@ struct chrdata *g_CurModelChr;
struct var80062960 *var80062960 = NULL;
s32 var80062964 = 0;
f32 var80062968 = 0;
bool var8006296c = false;
s32 g_SelectedAnimNum = 0;
u32 var80062974 = 0x00000000;
u32 var80062978 = 0x00000000;
u32 var8006297c = 0;
u32 var80062980 = 0;
@ -1096,7 +1093,7 @@ struct prop *chr0f020b14(struct prop *prop, struct model *model,
model->unk01 = 1;
chr->model = model;
chrSetLookAngle(chr, faceangle);
modelSetAnimPlaySpeed(model, PALUPF(var80062968), 0);
modelSetAnimPlaySpeed(model, 1, 0);
testpos.x = pos->x;
testpos.y = pos->y + 100;
@ -2155,26 +2152,10 @@ s32 chrTick(struct prop *prop)
chrTickPoisoned(chr);
if ((chr->chrflags & CHRCFLAG_HIDDEN) == 0 || (chr->chrflags & CHRCFLAG_00040000)) {
if (var8006296c) {
if (animHasFrames(g_SelectedAnimNum)) {
if (modelGetAnimNum(model) != g_SelectedAnimNum || !animHasFrames(modelGetAnimNum(model))) {
modelSetAnimation(model, g_SelectedAnimNum, 0, 0.0f, 0.5f, 0.0f);
}
}
} else {
chraTick(chr);
chraTick(chr);
if (chr->model == NULL) {
return TICKOP_FREE;
}
}
if (var80062974) {
lvupdate240 = 0;
if (var80062978) {
lvupdate240 = 1;
}
if (chr->model == NULL) {
return TICKOP_FREE;
}
}
@ -2347,7 +2328,7 @@ s32 chrTick(struct prop *prop)
onscreen = false;
}
if (!g_Vars.normmplayerisrunning && onscreen) {
if (onscreen && !g_Vars.normmplayerisrunning) {
if (chr->actiontype == ACT_DEAD
|| (chr->actiontype == ACT_DRUGGEDKO && (chr->chrflags & CHRCFLAG_KEEPCORPSEKO) == 0)) {
var8009cdac++;
@ -2381,7 +2362,7 @@ s32 chrTick(struct prop *prop)
g_ModelJointPositionedFunc = &chrHandleJointPositioned;
g_CurModelChr = chr;
if (CHRRACE(chr) == RACE_DRCAROLL && g_Vars.tickmode != TICKMODE_CUTSCENE) {
if (race == RACE_DRCAROLL && g_Vars.tickmode != TICKMODE_CUTSCENE) {
angle = chrGetInverseTheta(chr);
sp190.x = sinf(angle) * 19;
@ -4382,12 +4363,6 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
}
}
void chr0f028498(bool value)
{
var8006296c = value;
var8005efbc = value;
}
void chrsCheckForNoise(f32 noiseradius)
{
s32 i;

View File

@ -11,12 +11,6 @@ void chrmgrReset(void)
{
s32 i;
var80062968 = 1;
var8006296c = 0;
g_SelectedAnimNum = 0;
var80062974 = 0;
var80062978 = 0;
var8006297c = 0;
g_NextChrnum = 200;
g_ChrSlots = NULL;
g_NumChrSlots = 0;

View File

@ -1284,7 +1284,6 @@ Gfx *lvRender(Gfx *gdl)
PROFILE(PROFILEMARKER_LVR_PICKUP, propsTestForPickup());
PROFILE(PROFILEMARKER_LVR_BG, gdl = bgRender(gdl));
chr0f028498(false);
if (g_BeamsActive > 0) {
PROFILE(PROFILEMARKER_LVR_BEAMS, gdl = propsRenderBeams(gdl));

View File

@ -22,7 +22,6 @@ u32 var8005efb0 = 0;
bool g_ModelDistanceDisabled = false;
f32 g_ModelDistanceScale = 1;
bool var8005efbc = false;
f32 var8005efc0 = 0;
bool (*var8005efc4)(struct model *model, struct modelnode *node) = NULL;
@ -1569,7 +1568,7 @@ f32 modelGetAbsAnimSpeed(struct model *model)
s32 modelConstrainOrWrapAnimFrame(s32 frame, s16 animnum, f32 endframe)
{
if (frame < 0) {
if (var8005efbc || (g_Anims[animnum].flags & ANIMFLAG_LOOP)) {
if (g_Anims[animnum].flags & ANIMFLAG_LOOP) {
frame = animGetNumFrames(animnum) - (-frame % animGetNumFrames(animnum));
} else {
frame = 0;
@ -1577,7 +1576,7 @@ s32 modelConstrainOrWrapAnimFrame(s32 frame, s16 animnum, f32 endframe)
} else if (endframe >= 0 && frame > (s32)endframe) {
frame = ceil(endframe);
} else if (frame >= animGetNumFrames(animnum)) {
if (var8005efbc || (g_Anims[animnum].flags & ANIMFLAG_LOOP)) {
if (g_Anims[animnum].flags & ANIMFLAG_LOOP) {
frame = frame % animGetNumFrames(animnum);
} else {
frame = animGetNumFrames(animnum) - 1;