forked from oerkki/voxelands
enable_suffocation and enable_hunger should have no effect if enable_damage is false
This commit is contained in:
parent
3266833cb9
commit
f01e9a72f4
|
@ -4283,12 +4283,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
s8 suffocate = readS8(is);
|
||||
s8 hunger = readS8(is);
|
||||
|
||||
if (damage && g_settings->getBool("enable_damage")) {
|
||||
if (g_settings->getBool("enable_damage")) {
|
||||
if (damage) {
|
||||
actionstream<<player->getName()<<" damaged by "
|
||||
<<(int)damage<<" hp at "<<PP(player->getPosition()/BS)
|
||||
<<std::endl;
|
||||
}else{
|
||||
damage = 0;
|
||||
}
|
||||
if (suffocate && g_settings->getBool("enable_suffocation")) {
|
||||
actionstream<<player->getName()<<" lost "
|
||||
|
@ -4304,6 +4303,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
}else{
|
||||
hunger = 0;
|
||||
}
|
||||
}else{
|
||||
damage = 0;
|
||||
suffocate = 0;
|
||||
hunger = 0;
|
||||
}
|
||||
|
||||
if (!damage && !suffocate && !hunger) {
|
||||
SendPlayerHP(player);
|
||||
|
|
Loading…
Reference in New Issue