1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Damage: Play no damage sound when immortal (#8350)

Add isImmortal server-side for proper enable_damage handling
Rework log messages
This commit is contained in:
SmallJoker 2019-06-09 11:25:41 +02:00 committed by GitHub
parent 2ba6785f09
commit a687efa6df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 38 deletions

View file

@ -799,7 +799,7 @@ void Server::handleCommand_Damage(NetworkPacket* pkt)
return;
}
if (g_settings->getBool("enable_damage")) {
if (!playersao->isImmortal()) {
if (playersao->isDead()) {
verbosestream << "Server::ProcessData(): Info: "
"Ignoring damage as player " << player->getName()
@ -1156,10 +1156,6 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
if (pointed_object->isGone())
return;
actionstream<<player->getName()<<" punches object "
<<pointed.object_id<<": "
<<pointed_object->getDescription()<<std::endl;
ItemStack punchitem = playersao->getWieldedItemOrHand();
ToolCapabilities toolcap =
punchitem.getToolCapabilities(m_itemdef);