Merge remote-tracking branch 'origin/master' into terencehill/hud_code_restructure
authorSamual Lenks <samual@xonotic.org>
Sat, 4 May 2013 03:02:08 +0000 (23:02 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 4 May 2013 03:02:08 +0000 (23:02 -0400)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/teams.qh
qcsrc/server/command/vote.qc
qcsrc/server/mutators/gamemode_domination.qc

index a9f8410..109b83d 100644 (file)
@@ -313,6 +313,10 @@ void CSQCPlayer_FallbackFrame_PostUpdate(float isnew)
        }
        self.csqcmodel_isdead = IS_DEAD_FRAME(self.frame);
 }
+void CSQCPlayer_AnimDecide_PostUpdate(float isnew)
+{
+       self.csqcmodel_isdead = !!(self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
+}
 float CSQCPlayer_FallbackFrame(float f)
 {
        if(frameduration(self.modelindex, f) > 0)
@@ -692,7 +696,9 @@ void CSQCModel_Hook_PostUpdate(float isnew, float isplayer, float islocalplayer)
        if(self.isplayermodel)
        {
                CSQCPlayer_ForceModel_PostUpdate();
-               if(!isplayer)
+               if(isplayer)
+                       CSQCPlayer_AnimDecide_PostUpdate(isnew);
+               else
                        CSQCPlayer_FallbackFrame_PostUpdate(isnew);
        }
        CSQCModel_Effects_PostUpdate();
index e77b764..c1ef62d 100644 (file)
@@ -92,6 +92,20 @@ string Team_ColorName(float teamid)
     return NAME_NEUTRAL;
 }
 
+// used for replacement in filenames or such where the name CANNOT be allowed to be translated
+string Static_Team_ColorName(float teamid)
+{
+    switch(teamid)
+    {
+               case NUM_TEAM_1: return STATIC_NAME_TEAM_1;
+       case NUM_TEAM_2: return STATIC_NAME_TEAM_2;
+       case NUM_TEAM_3: return STATIC_NAME_TEAM_3;
+       case NUM_TEAM_4: return STATIC_NAME_TEAM_4;
+       }
+       
+    return NAME_NEUTRAL;
+}
+
 float Team_ColorToTeam(string team_color)
 {
        switch(strtolower(team_color))
@@ -141,6 +155,10 @@ float Team_TeamToNumber(float teamid)
 #define Team_ColorName_Lower(teamid) strtolower(Team_ColorName(teamid))
 #define Team_ColorName_Upper(teamid) strtoupper(Team_ColorName(teamid))
 
+// used for replacement in filenames or such where the name CANNOT be allowed to be translated
+#define Static_Team_ColorName_Lower(teamid) strtolower(Static_Team_ColorName(teamid))
+#define Static_Team_ColorName_Upper(teamid) strtoupper(Static_Team_ColorName(teamid))
+
 #define Team_FullName(teamid) strcat(Team_ColorName(teamid), " ", NAME_TEAM, "^7")
 #define Team_ColoredFullName(teamid) strcat(Team_ColorCode(teamid), Team_ColorName(teamid), " ", NAME_TEAM, "^7")
 
index 199e326..5e7810a 100644 (file)
@@ -611,7 +611,7 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl
                        
                        if(accepted > 0)
                        {
-                               string reason = ((argc > next_token) ? substring(vote_command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)) : "No reason provided");
+                               string reason = ((argc > next_token) ? substring(vote_command, argv_start_index(next_token), strlen(vote_command) - argv_start_index(next_token)) : "No reason provided");
                                string command_arguments;
                                
                                if(first_command == "kickban")
index 051eaa3..98b9b40 100644 (file)
@@ -19,6 +19,7 @@ void dompoint_captured ()
 {
        entity head;
        float old_delay, old_team, real_team;
+       string msg = "dom-neut";
 
        // now that the delay has expired, switch to the latest team to lay claim to this point
        head = self.owner;
@@ -74,8 +75,16 @@ void dompoint_captured ()
        SUB_UseTargets ();
        self.delay = old_delay;
        self.team = old_team;
+       
+       switch(self.team)
+       {
+               case NUM_TEAM_1: msg = "dom-red"; break;
+               case NUM_TEAM_2: msg = "dom-blue"; break;
+               case NUM_TEAM_3: msg = "dom-yellow"; break;
+               case NUM_TEAM_4: msg = "dom-pink"; break;
+       }
 
-       WaypointSprite_UpdateSprites(self.sprite, strcat("dom-", Team_ColorName_Lower(self.goalentity.team)), "", "");
+       WaypointSprite_UpdateSprites(self.sprite, msg, "", "");
        
        total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
        for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )