Skip to content

Commit aaf26b3

Browse files
committedMar 16, 2015
If player is dead, permit it to respawn, even if damages are not enabled
* Mods can do setHP function to do damages and override the enable_damage value sometimes
1 parent b2801d8 commit aaf26b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/network/packethandlers/server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ void Server::handleCommand_Respawn(NetworkPacket* pkt)
13351335
return;
13361336
}
13371337

1338-
if (!player->isDead() || !g_settings->getBool("enable_damage"))
1338+
if (!player->isDead())
13391339
return;
13401340

13411341
RespawnPlayer(pkt->getPeerId());

4 commit comments

Comments
 (4)

HybridDog commented on Mar 17, 2015

@HybridDog
Contributor

usually mods only should be able to damage the player, e.g. by changing hp, if enable_damage is true
if they need to look for this manually, a lot mods would need to become updated, I think

nerzhul commented on Mar 17, 2015

@nerzhul
ContributorAuthor

No set_hp call is correct. I will propre a do_damage PR and this call must be used by mods, because enable_damage will use it :)

set_hp is more powerful but misused by modders

HybridDog commented on Mar 17, 2015

@HybridDog
Contributor

If I remember correctly, set_hp only worked for non player entities if damage was disabled.

nerzhul commented on Mar 17, 2015

@nerzhul
ContributorAuthor

l_object.cpp L251

ServerActiveObject *co = getobject(ref);
co->setHP(hp);

No filtering. Everything can be affected by this

Please sign in to comment.