mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix damage wraparound if very high damage (#11872)
This commit is contained in:
parent
85da2e284b
commit
b81948a14c
7 changed files with 10 additions and 8 deletions
|
@ -240,7 +240,7 @@ void ScriptApiEntity::luaentity_Step(u16 id, float dtime,
|
|||
// tool_capabilities, direction, damage)
|
||||
bool ScriptApiEntity::luaentity_Punch(u16 id,
|
||||
ServerActiveObject *puncher, float time_from_last_punch,
|
||||
const ToolCapabilities *toolcap, v3f dir, s16 damage)
|
||||
const ToolCapabilities *toolcap, v3f dir, s32 damage)
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
const collisionMoveResult *moveresult);
|
||||
bool luaentity_Punch(u16 id,
|
||||
ServerActiveObject *puncher, float time_from_last_punch,
|
||||
const ToolCapabilities *toolcap, v3f dir, s16 damage);
|
||||
const ToolCapabilities *toolcap, v3f dir, s32 damage);
|
||||
bool luaentity_on_death(u16 id, ServerActiveObject *killer);
|
||||
void luaentity_Rightclick(u16 id, ServerActiveObject *clicker);
|
||||
void luaentity_on_attach_child(u16 id, ServerActiveObject *child);
|
||||
|
|
|
@ -60,7 +60,7 @@ bool ScriptApiPlayer::on_punchplayer(ServerActiveObject *player,
|
|||
float time_from_last_punch,
|
||||
const ToolCapabilities *toolcap,
|
||||
v3f dir,
|
||||
s16 damage)
|
||||
s32 damage)
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
// Get core.registered_on_punchplayers
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
void on_cheat(ServerActiveObject *player, const std::string &cheat_type);
|
||||
bool on_punchplayer(ServerActiveObject *player, ServerActiveObject *hitter,
|
||||
float time_from_last_punch, const ToolCapabilities *toolcap,
|
||||
v3f dir, s16 damage);
|
||||
v3f dir, s32 damage);
|
||||
void on_rightclickplayer(ServerActiveObject *player, ServerActiveObject *clicker);
|
||||
s32 on_player_hpchange(ServerActiveObject *player, s32 hp_change,
|
||||
const PlayerHPChangeReason &reason);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue