mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
[General] Add extra death debug, don't request data from player on death
This commit is contained in:
parent
c4b11a1251
commit
0d32bf5943
3 changed files with 13 additions and 5 deletions
|
@ -386,12 +386,10 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
case ID_PLAYER_RESURRECT:
|
case ID_PLAYER_RESURRECT:
|
||||||
{
|
{
|
||||||
DEBUG_PRINTF("ID_PLAYER_RESURRECT\n");
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_RESURRECT from %s", player->npc.mName.c_str());
|
||||||
//packetResurrect.Read(player);
|
|
||||||
player->creatureStats.mDead = false;
|
player->creatureStats.mDead = false;
|
||||||
myPacket->Send(player, true);
|
myPacket->Send(player, true);
|
||||||
playerController->GetPacket(ID_PLAYER_POS)->RequestData(player->guid);
|
|
||||||
playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->RequestData(player->guid);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnPlayerResurrect")>(player->getId());
|
Script::Call<Script::CallbackIdentity("OnPlayerResurrect")>(player->getId());
|
||||||
|
|
||||||
|
|
|
@ -452,8 +452,11 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
case ID_PLAYER_DEATH:
|
case ID_PLAYER_DEATH:
|
||||||
{
|
{
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_DEATH from server");
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_DEATH from server");
|
||||||
|
|
||||||
if (guid == myGuid)
|
if (guid == myGuid)
|
||||||
{
|
{
|
||||||
|
LOG_APPEND(Log::LOG_INFO, "- Packet was about me");
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::DynamicStat<float> health = player.getClass().getCreatureStats(player).getHealth();
|
MWMechanics::DynamicStat<float> health = player.getClass().getCreatureStats(player).getHealth();
|
||||||
health.setCurrent(0);
|
health.setCurrent(0);
|
||||||
|
@ -463,6 +466,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
else if (pl != 0)
|
else if (pl != 0)
|
||||||
{
|
{
|
||||||
LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", pl->npc.mName.c_str());
|
LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", pl->npc.mName.c_str());
|
||||||
|
|
||||||
MWMechanics::DynamicStat<float> health;
|
MWMechanics::DynamicStat<float> health;
|
||||||
pl->creatureStats.mDead = true;
|
pl->creatureStats.mDead = true;
|
||||||
health.readState(pl->creatureStats.mDynamic[0]);
|
health.readState(pl->creatureStats.mDynamic[0]);
|
||||||
|
@ -474,8 +478,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
}
|
}
|
||||||
case ID_PLAYER_RESURRECT:
|
case ID_PLAYER_RESURRECT:
|
||||||
{
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_RESURRECT from server");
|
||||||
|
|
||||||
if (guid == myGuid)
|
if (guid == myGuid)
|
||||||
{
|
{
|
||||||
|
LOG_APPEND(Log::LOG_INFO, "- Packet was about me");
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
player.getClass().getCreatureStats(player).resurrect();
|
player.getClass().getCreatureStats(player).resurrect();
|
||||||
|
|
||||||
|
@ -490,6 +498,8 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
}
|
}
|
||||||
else if (pl != 0)
|
else if (pl != 0)
|
||||||
{
|
{
|
||||||
|
LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", pl->npc.mName.c_str());
|
||||||
|
|
||||||
pl->creatureStats.mDead = false;
|
pl->creatureStats.mDead = false;
|
||||||
if (pl->creatureStats.mDynamic[0].mMod < 1)
|
if (pl->creatureStats.mDynamic[0].mMod < 1)
|
||||||
pl->creatureStats.mDynamic[0].mMod = 1;
|
pl->creatureStats.mDynamic[0].mMod = 1;
|
||||||
|
|
|
@ -161,7 +161,7 @@ add_component_dir (openmw-mp
|
||||||
Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills
|
Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills
|
||||||
Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState
|
Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState
|
||||||
|
|
||||||
Packets/Player/PacketPlayerResurrect
|
Packets/Player/PacketPlayerDeath Packets/Player/PacketPlayerResurrect
|
||||||
|
|
||||||
Packets/Player/PacketGUIBoxes Packets/Player/PacketTime
|
Packets/Player/PacketGUIBoxes Packets/Player/PacketTime
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue