MCPcopy Create free account
hub / github.com/crossuo/crossuo / UpdatePlayer

Method UpdatePlayer

src/GameObjects/GameWorld.cpp:1037–1109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035}
1036
1037void CGameWorld::UpdatePlayer(
1038 uint32_t serial,
1039 uint16_t graphic,
1040 uint8_t graphicIncrement,
1041 uint16_t color,
1042 uint8_t flags,
1043 int x,
1044 int y,
1045 uint16_t serverID,
1046 uint8_t direction,
1047 char z)
1048{
1049 if (serial == g_PlayerSerial)
1050 {
1051 g_Player->CloseBank();
1052
1053 g_Walker.WalkingFailed = false;
1054
1055 g_Player->SetX(x);
1056 g_Player->SetY(y);
1057 g_Player->SetZ(z);
1058
1059 g_RemoveRangeXY.X = x;
1060 g_RemoveRangeXY.Y = y;
1061
1062 UOI_PLAYER_XYZ_DATA xyzData = { g_RemoveRangeXY.X, g_RemoveRangeXY.Y, 0 };
1063 PLUGIN_EVENT(UOMSG_UPDATE_REMOVE_POS, &xyzData);
1064
1065 g_GameScreen.UpdateDrawPos = true;
1066
1067 const bool oldDead = g_Player->IsDead();
1068 uint16_t oldGraphic = g_Player->Graphic;
1069
1070 g_Player->Graphic = graphic;
1071 g_Player->OnGraphicChange();
1072
1073 g_Player->Direction = direction;
1074 g_Player->Color = g_ColorManager.FixColor(color);
1075
1076 //UpdatePlayerCoordinates(x, y, z, serverID);
1077
1078 g_Player->SetFlags(flags);
1079
1080 g_Walker.DenyWalk(-1, -1, -1, -1);
1081 g_Weather.Reset();
1082
1083 if ((oldGraphic != 0u) && oldGraphic != g_Player->Graphic)
1084 {
1085 if (g_Player->IsDead())
1086 {
1087 g_Target.Reset();
1088 }
1089 }
1090
1091 if (oldDead != g_Player->IsDead())
1092 {
1093 if (g_Player->IsDead())
1094 {

Callers 1

PACKET_HANDLERFunction · 0.80

Calls 12

CloseBankMethod · 0.80
SetXMethod · 0.80
SetYMethod · 0.80
SetZMethod · 0.80
IsDeadMethod · 0.80
FixColorMethod · 0.80
SetFlagsMethod · 0.80
DenyWalkMethod · 0.80
ChangeSeasonMethod · 0.80
RemoveRangedGumpsMethod · 0.80
OnGraphicChangeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected