mirror of
https://github.com/luanti-org/luanti.git
synced 2026-01-12 20:25:26 +01:00
Clarify that punch toolcaps are not optional (#16720)
This commit is contained in:
@@ -323,7 +323,7 @@ void LuaEntitySAO::getStaticData(std::string *result) const
|
||||
}
|
||||
|
||||
u32 LuaEntitySAO::punch(v3f dir,
|
||||
const ToolCapabilities *toolcap,
|
||||
const ToolCapabilities &toolcap,
|
||||
ServerActiveObject *puncher,
|
||||
float time_from_last_punch,
|
||||
u16 initial_wear)
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
bool shouldUnload() const { return true; }
|
||||
void getStaticData(std::string *result) const;
|
||||
|
||||
u32 punch(v3f dir, const ToolCapabilities *toolcap = nullptr,
|
||||
u32 punch(v3f dir, const ToolCapabilities &toolcap,
|
||||
ServerActiveObject *puncher = nullptr,
|
||||
float time_from_last_punch = 1000000.0f,
|
||||
u16 initial_wear = 0);
|
||||
|
||||
@@ -450,14 +450,11 @@ void PlayerSAO::setLookPitchAndSend(const float pitch)
|
||||
}
|
||||
|
||||
u32 PlayerSAO::punch(v3f dir,
|
||||
const ToolCapabilities *toolcap,
|
||||
const ToolCapabilities &toolcap,
|
||||
ServerActiveObject *puncher,
|
||||
float time_from_last_punch,
|
||||
u16 initial_wear)
|
||||
{
|
||||
if (!toolcap)
|
||||
return 0;
|
||||
|
||||
// No effect if PvP disabled or if immortal
|
||||
if (isImmortal() || !g_settings->getBool("enable_pvp")) {
|
||||
if (puncher && puncher->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
Interaction interface
|
||||
*/
|
||||
|
||||
u32 punch(v3f dir, const ToolCapabilities *toolcap, ServerActiveObject *puncher,
|
||||
u32 punch(v3f dir, const ToolCapabilities &toolcap, ServerActiveObject *puncher,
|
||||
float time_from_last_punch, u16 initial_wear = 0) override;
|
||||
void rightClick(ServerActiveObject *clicker) override;
|
||||
void setHP(s32 hp, const PlayerHPChangeReason &reason) override
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
float resetTimeFromLastPunch()
|
||||
{
|
||||
float r = m_time_from_last_punch;
|
||||
m_time_from_last_punch = 0.0;
|
||||
m_time_from_last_punch = 0;
|
||||
return r;
|
||||
}
|
||||
void noCheatDigStart(const v3s16 &p)
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
|
||||
// Returns added tool wear
|
||||
virtual u32 punch(v3f dir,
|
||||
const ToolCapabilities *toolcap = nullptr,
|
||||
const ToolCapabilities &toolcap,
|
||||
ServerActiveObject *puncher = nullptr,
|
||||
float time_from_last_punch = 1000000.0f,
|
||||
u16 initial_wear = 0)
|
||||
|
||||
Reference in New Issue
Block a user