diff --git a/src/g_shared/sbar_mugshot.cpp b/src/g_shared/sbar_mugshot.cpp index e48a047bb..02b72167a 100644 --- a/src/g_shared/sbar_mugshot.cpp +++ b/src/g_shared/sbar_mugshot.cpp @@ -335,6 +335,7 @@ bool FMugShot::SetState(const char *state_name, bool wait_till_done, bool reset) // //=========================================================================== +CVAR(Bool,st_oldouch,false,CVAR_ARCHIVE) int FMugShot::UpdateState(player_t *player, StateFlags stateflags) { int i; @@ -357,9 +358,10 @@ int FMugShot::UpdateState(player_t *player, StateFlags stateflags) } } + bool ouch = (!st_oldouch && FaceHealth - player->health > ST_MUCHPAIN) || (st_oldouch && player->health - FaceHealth > ST_MUCHPAIN); if (player->damagecount && // Now go in if pain is disabled but we think ouch will be shown (and ouch is not disabled!) - (!(stateflags & DISABLEPAIN) || (((FaceHealth != -1 && FaceHealth - player->health > ST_MUCHPAIN) || bOuchActive) && !(stateflags & DISABLEOUCH)))) + (!(stateflags & DISABLEPAIN) || (((FaceHealth != -1 && ouch) || bOuchActive) && !(stateflags & DISABLEOUCH)))) { int damage_angle = 1; if (player->attacker && player->attacker != player->mo) @@ -391,7 +393,7 @@ int FMugShot::UpdateState(player_t *player, StateFlags stateflags) } } bool use_ouch = false; - if (((FaceHealth != -1 && FaceHealth - player->health > ST_MUCHPAIN) || bOuchActive) && !(stateflags & DISABLEOUCH)) + if (((FaceHealth != -1 && ouch) || bOuchActive) && !(stateflags & DISABLEOUCH)) { use_ouch = true; full_state_name = "ouch."; @@ -418,7 +420,7 @@ int FMugShot::UpdateState(player_t *player, StateFlags stateflags) else { bool use_ouch = false; - if (((FaceHealth != -1 && player->health - FaceHealth > ST_MUCHPAIN) || bOuchActive) && !(stateflags & DISABLEOUCH)) + if (((FaceHealth != -1 && ouch) || bOuchActive) && !(stateflags & DISABLEOUCH)) { use_ouch = true; full_state_name = "ouch."; diff --git a/src/textures/anim_switches.cpp b/src/textures/anim_switches.cpp index ca8253203..b065f0b96 100644 --- a/src/textures/anim_switches.cpp +++ b/src/textures/anim_switches.cpp @@ -325,13 +325,13 @@ void FTextureManager::AddSwitchPair (FSwitchDef *def1, FSwitchDef *def2) { index1 = i; sw1 = mSwitchDefs[index1]; - if (index2 != -1) break; + if (index2 != -1u) break; } if (mSwitchDefs[i]->PreTexture == def2->PreTexture) { index2 = i; sw2 = mSwitchDefs[index2]; - if (index1 != -1) break; + if (index1 != -1u) break; } } diff --git a/tools/zipdir/zipdir.c b/tools/zipdir/zipdir.c index 01a997958..ae4738b04 100644 --- a/tools/zipdir/zipdir.c +++ b/tools/zipdir/zipdir.c @@ -610,6 +610,7 @@ dir_tree_t *add_dirs(char **argv) { // Skip hidden directories. (Prevents SVN bookkeeping // info from being included.) + // [BL] Also skip backup files. fts_set(fts, ent, FTS_SKIP); } if (ent->fts_info == FTS_D && ent->fts_level == 0) @@ -628,6 +629,11 @@ dir_tree_t *add_dirs(char **argv) // We're only interested in remembering files. continue; } + else if(ent->fts_name[strlen(ent->fts_name)-1] == '~') + { + // Don't remember backup files. + continue; + } file = alloc_file_entry("", ent->fts_path, ent->fts_statp->st_mtime); if (file == NULL) { @@ -1030,10 +1036,10 @@ int append_to_zip(FILE *zip_file, file_sorted_t *filep, FILE *ozip, BYTE *odir) if (compbuf[0] != NULL) { free(compbuf[0]); - } - if (compbuf[1] != NULL) - { - free(compbuf[1]); + } + if (compbuf[1] != NULL) + { + free(compbuf[1]); } return 1; } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 5097106e3..8446ea00c 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -736,6 +736,7 @@ OptionMenu "HUDOptions" Option "Display nametags", "displaynametags", "DisplayTagsTypes" Option "Nametag color", "nametagcolor", "TextColors", "displaynametags" Option "Stretch status bar", "st_scale", "OnOff" + Option "Use old ouch mug shot formula", "st_oldouch", "OnOff" } //-------------------------------------------------------------------------------------------