srb2::Mobj: add hitlag methods

This commit is contained in:
James R 2023-11-27 04:35:54 -08:00
parent 5cd6bf81f7
commit 5cbb11cbfc

View file

@ -15,6 +15,8 @@
#include "math/fixed.hpp"
#include "math/vec.hpp"
#include "doomtype.h"
#include "k_hitlag.h"
#include "info.h"
#include "p_local.h"
#include "p_mobj.h"
@ -197,6 +199,18 @@ struct Mobj : mobj_t
voice(sfx, volume);
}
}
//
// Hitlag
//
INT32 hitlag() const { return mobj_t::hitlag; }
void hitlag(INT32 tics, bool damage = false) { K_AddHitLag(this, tics, damage); }
void hitlag(Mobj* inflictor, Mobj* source, INT32 tics, bool damage)
{
K_SetHitLagForObjects(this, inflictor, source, tics, damage);
}
};
}; // namespace srb2