1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-18 02:58:13 -05:00

Encounter: change teammate waypoint icon position based on stance

This commit is contained in:
Jbleezy
2023-03-04 19:15:13 -08:00
parent 10f6ba4dba
commit fb58c0a53d

View File

@ -943,9 +943,10 @@ team_player_waypoint()
{
flag_wait( "initial_blackscreen_passed" );
self.player_waypoint_origin = spawn( "script_model", self.origin + (0, 0, 72) );
self.player_waypoint_origin = spawn( "script_model", self.origin );
self.player_waypoint_origin setmodel( "tag_origin" );
self.player_waypoint_origin linkto( self );
self thread team_player_waypoint_origin_think();
self.player_waypoint = [];
self.player_waypoint = newTeamHudElem(self.team);
@ -968,6 +969,38 @@ team_player_waypoint()
}
}
team_player_waypoint_origin_think()
{
prev_stance = "none";
while (isDefined(self.player_waypoint_origin))
{
if (self getStance() != prev_stance)
{
prev_stance = self getStance();
self.player_waypoint_origin unlink();
if (self getStance() == "stand")
{
self.player_waypoint_origin.origin = self.origin + (0, 0, 72);
}
else if (self getStance() == "crouch")
{
self.player_waypoint_origin.origin = self.origin + (0, 0, 56);
}
else if (self getStance() == "prone")
{
self.player_waypoint_origin.origin = self.origin + (0, 0, 30);
}
self.player_waypoint_origin linkto(self);
}
wait 0.05;
}
}
headstomp_watcher()
{
level endon("end_game");