fix: crash bug introduced in latest commit (resolves #630)

fix: unnecessary assignments here and there
This commit is contained in:
jeefo 2024-10-20 17:31:45 +03:00
commit 3d84b96534
No known key found for this signature in database
GPG key ID: D696786B81B667C8
3 changed files with 7 additions and 12 deletions

View file

@ -1496,27 +1496,25 @@ void PlayerHitboxEnumerator::update (edict_t *ent) {
parts->head.z += bboxset[hitbox].bbmax.z;
parts->head = { ent->v.origin.x, ent->v.origin.y, parts->head.z };
}
hitbox = kInvalidHitbox;
// get the body (stomach)
hitbox = getHitbox (studiohdr, bboxset, PlayerPart::Stomach);
if (hitbox != kInfiniteDistance) {
if (hitbox != kInvalidHitbox) {
engfuncs.pfnGetBonePosition (ent, bboxset[hitbox].bone, parts->stomach, nullptr);
}
hitbox = kInvalidHitbox;
// get the left (arm)
hitbox = getHitbox (studiohdr, bboxset, PlayerPart::LeftArm);
if (hitbox != kInfiniteDistance) {
if (hitbox != kInvalidHitbox) {
engfuncs.pfnGetBonePosition (ent, bboxset[hitbox].bone, parts->left, nullptr);
}
// get the right (arm)
hitbox = getHitbox (studiohdr, bboxset, PlayerPart::RightArm);
if (hitbox != kInfiniteDistance) {
if (hitbox != kInvalidHitbox) {
engfuncs.pfnGetBonePosition (ent, bboxset[hitbox].bone, parts->right, nullptr);
}
return;