1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Move ServerRemotePlayer to a separate file

This commit is contained in:
Perttu Ahola 2011-12-02 10:44:20 +02:00
parent 89bc306632
commit 5344dec760
10 changed files with 459 additions and 374 deletions

View file

@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodemetadata.h"
#include "main.h" // For g_settings, g_profiler
#include "gamedef.h"
#include "serverremoteplayer.h"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
@ -2189,15 +2190,17 @@ void ClientEnvironment::processActiveObjectMessage(u16 id,
Callbacks for activeobjects
*/
void ClientEnvironment::damageLocalPlayer(u8 damage)
void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
{
LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
if(lplayer->hp > damage)
lplayer->hp -= damage;
else
lplayer->hp = 0;
if(handle_hp){
if(lplayer->hp > damage)
lplayer->hp -= damage;
else
lplayer->hp = 0;
}
ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE;