Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
154704a
removed client
mfabiojrs Oct 3, 2025
6f6061c
update gitignore
mfabiojrs Oct 3, 2025
c9e6582
revert changes in filtercountrycode, fix cchist
mfabiojrs Oct 3, 2025
96be53f
fix: FPCN_DEATHCAM was incorrectly sharing the same value as FPCN_FLY
mfabiojrs Oct 3, 2025
6fbedda
fix: start next game
mfabiojrs Oct 3, 2025
87157be
feat: add SV_EDITMODE
mfabiojrs Oct 3, 2025
0e4f62d
feat: add SV_NEWMAP
mfabiojrs Oct 3, 2025
cc2f571
fix: allow taking screenshots while typing in the console
mfabiojrs Oct 6, 2025
364c7d4
fix: block edit mode when watching demos
mfabiojrs Oct 6, 2025
d8f8bc5
feat: mute game audio when window loses focus and restore it when foc…
mfabiojrs Oct 6, 2025
055a0d4
minor adjustments
mfabiojrs Oct 6, 2025
708d7bc
fix: ignoring pitch in LOD calculation
mfabiojrs Oct 6, 2025
5e26cad
fix: allow continuous jump in editfly mode
mfabiojrs Oct 7, 2025
18bdcaa
feat: force to spectate to the mulitplayer ui
mfabiojrs Oct 9, 2025
57b0ad7
feat: hide models too close to the ceiling in SM_OVERVIEW
mfabiojrs Oct 10, 2025
dd1d167
feat: move 'shuffle teams requires teammode' message to voteerrors
mfabiojrs Oct 10, 2025
cf7b292
feat: remove client-side pause validation and add VOTEE_PAUSE to vote…
mfabiojrs Oct 10, 2025
2645951
feat: allow fly spectators to ignore collision plclip, tagclips, and …
mfabiojrs Oct 11, 2025
175ceee
feat: drop flag when entering editmode
mfabiojrs Oct 12, 2025
00dc691
fix: clear disconnected player scores when disconnecting
mfabiojrs Oct 12, 2025
9653920
tweaks
mfabiojrs Oct 13, 2025
b56b1ee
feat: add configurable radar visibility for non-team game modes
mfabiojrs Oct 21, 2025
dcce7e2
fix: restore showmap functionality in edit mode
mfabiojrs Oct 21, 2025
938ff60
fix: cube selection in editmode inside walls and outside world bounds
mfabiojrs Oct 21, 2025
0243888
fix: prevent waypoint placement in tagclip areas
mfabiojrs Oct 21, 2025
9969f8d
fix: wpsave to use current map name and add custom name support
mfabiojrs Oct 24, 2025
019c67c
fix: enforce vita bans immediately on servitaupdate
mfabiojrs Oct 24, 2025
d73ed93
feat: add missing menu controls and implement dynamic dependencies
mfabiojrs Oct 25, 2025
918094a
fix: space key dual behavior in text input menus
mfabiojrs Oct 26, 2025
a9a25df
fix: add KP_ENTER support to text input menu items
mfabiojrs Oct 26, 2025
71fce50
fix: prevent menu enter sound on sliders and radios
mfabiojrs Oct 27, 2025
a2c6b75
fix: stop player sounds on death
mfabiojrs Oct 28, 2025
aedfc07
feat: add option to keep game audio playing in background
mfabiojrs Oct 28, 2025
28351a6
fix: flag collision use 3D collision for flag in base
mfabiojrs Nov 14, 2025
d2dc649
comment out flag drop on edit mode entry
mfabiojrs Nov 14, 2025
fd32324
fix: add sc_score to the settings and fix the display only in multipl…
mfabiojrs Nov 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
.travis.yml
*.o
*.lo
*.vs
shadows.dat
bin_unix/native_client
bin_unix/native_server
bin_win32/ac_*
bin_win32/private/*
bin_win/logs/*
config/authpreprivate.cfg
config/authprivate.cfg
config/history
Expand Down Expand Up @@ -35,6 +39,12 @@ source/src/ac_client
source/src/ac_server
source/src/cube.h.gch
source/src/Makefile_local
source/vcpp/.vs
source/vcpp/Debug
source/vcpp/Profile
source/vcpp/Release
source/vcpp/Standalone
source/vcpp/Standalone Debug
clientlog*.txt
dumpmapconfig.txt
packetlog.txt
Expand Down
Binary file removed bin_win32/ac_client.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions config/docs.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3721,12 +3721,12 @@ docref [cleardemo];
docident [deleteservermap] [Deletes a map from the current server.];
docargument [A] [map name] [] [0];
docident [forceme] [Calls a vote to forceteam yourself to the specified team.];
docargument [T] [the team to force yourself to] [0-4] [0];
docargument [T] [the team to force yourself to] [0 (CLA), 1 (RVSF), 2 (CLA-SPECT), 3 (RVSF-SPECT), 4 (SPECTATOR)] [0];
docremark [By default, if you are on team CLA or RVSF, this command will force you to the enemy team, no arguments necessary.];
docref [forceteam];
docident [forceteam] [Calls a vote to force the specified player to switch to the specified team.];
docargument [C] [client number of player] [integer] [0];
docargument [T] [the team to force to] [0-4] [0];
docargument [T] [the team to force to] [0 (CLA), 1 (RVSF), 2 (CLA-SPECT), 3 (RVSF-SPECT), 4 (SPECTATOR)] [0];
docref [forceme];
docref [setadmin];
docident [getvita] [Get vita for a client.];
Expand Down
15 changes: 15 additions & 0 deletions config/menus_multiplayer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,27 @@ menuinitselection 2
newmenu [Team adjustment]
menuitem [Initiate shuffleteams] shuffleteams
menuitem [Force a team change] [ showmenu [force team] ]
menuitem [Force to spectate] [ showmenu [force spectate] ]
menuitem [Force yourself to enemy team] forceme
menuitem [Initiate autoteam] [ showmenu Auto-team ]

//// In-Game > Team adjustment > force team ////
// hardcoded

//// In-Game > Team adjustment > force spectate ////
// hardcoded

//// In-Game > Team adjustment > force spectate > select team ////

newmenu [Force to spectator team]
tempalias _forcespectcn 0
menuinit [
resetcurmenu
menuitem "Force to team \f3CLA-SPECT" [ forceteam $_forcespectcn 2 ]
menuitem "Force to team \f1RVSF-SPECT" [ forceteam $_forcespectcn 3 ]
menuitem "Force to SPECTATOR" [ forceteam $_forcespectcn 4 ]
]

//// In-Game > Team adjustment > Auto-team ////

newmenu Auto-team
Expand Down
195 changes: 137 additions & 58 deletions config/menus_settings.cfg

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions config/opt/compatibility.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ const orderscorecolumns [
sc_flags 2;
sc_frags 3;
sc_deaths 4;
sc_lag 5;
sc_score 5;
sc_lag 6;
sc_ratio -1;
] [
sc_flags 0;
sc_frags 1;
sc_deaths 2;
sc_ratio -1;
sc_lag 4;
sc_clientnum 5;
sc_name 6;
sc_score 4;
sc_lag 5;
sc_clientnum 6;
sc_name 7;
]
]

Expand Down
12 changes: 12 additions & 0 deletions source/src/audiomanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,18 @@ void audiomanager::detachsounds(playerent *owner)
locations.replaceworldobjreference(physentreference(owner), staticreference(owner->o));
}

void audiomanager::stopplayersounds(playerent *owner)
{
if(nosound) return;
// stop and drop all sounds from this player
physentreference ref(owner);
loopv(locations)
{
location *l = locations[i];
if(!l || !l->ref || l->stale) continue;
if(*l->ref == ref) l->drop();
}
}

VARP(maxsoundsatonce, 0, 32, 100);

Expand Down
19 changes: 16 additions & 3 deletions source/src/bot/bot_waypoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,11 @@ bool CWaypointClass::CanPlaceNodeHere(const vec &from)
return false;
}

if (s->tag & TAGANYCLIP)
{
return false;
}

if (fabs((float)(s->ceil - s->floor)) < player1->radius)
{
return false;
Expand Down Expand Up @@ -1696,12 +1701,20 @@ void wpvisible(int *on)

COMMAND(wpvisible, "i");

void wpsave(void)
void wpsave(char *name)
{
WaypointClass.SaveWaypoints();
if(name && name[0])
{
WaypointClass.SetMapName(name);
}
else
{
WaypointClass.SetMapName(getclientmap());
}
WaypointClass.SaveWaypoints();
}

COMMAND(wpsave, "");
COMMAND(wpsave, "s");

void wpload(void)
{
Expand Down
3 changes: 2 additions & 1 deletion source/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ void disconnect(int onlyclean, int async)
loopv(players) zapplayer(players[i]);
clearvote();
audiomgr.clearworldsounds(false);
discscores.shrink(0);
localdisconnect();
}
if(!onlyclean) localconnect();
Expand Down Expand Up @@ -284,7 +285,7 @@ COMMAND(hudecho, "c");

void whereami()
{
conoutf("you are at (%.2f,%.2f)", player1->o.x, player1->o.y);
conoutf("you are at (%.2f, %.2f)", player1->o.x, player1->o.y);
}
COMMAND(whereami, "");

Expand Down
34 changes: 26 additions & 8 deletions source/src/clientgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ void deathstate(playerent *pl)
pl->attacking = false;
pl->weaponsel->onownerdies();

audiomgr.stopplayersounds(pl); // stop all sounds from this player when they die

if(pl==player1)
{
if(showscoresondeath) showscores(true);
Expand Down Expand Up @@ -1673,14 +1675,9 @@ COMMAND(gonext, "i");
COMMANDN(callvote, scallvote, "iss"); //fixme,ah
COMMANDF(vote, "i", (int *v) { vote(*v); });

void cmd_pause(int* arg1)
void cmd_pause(int *arg1)
{
if(*arg1 != 0 && *arg1 != 1) return;
if(servstate.mastermode != MM_MATCH && servstate.mastermode != MM_PRIVATE)
{
conoutf("You may only pause the game in mastermode private or match.");
return;
}
defformatstring(m)("%d", *arg1);
callvote(SA_PAUSE, m, "-1", "0");
}
Expand Down Expand Up @@ -1740,7 +1737,7 @@ COMMAND(setadmin, "is");

static vector<mline> mlines;

void *kickmenu = NULL, *banmenu = NULL, *forceteammenu = NULL, *giveadminmenu = NULL;
void *kickmenu = NULL, *banmenu = NULL, *forceteammenu = NULL, *giveadminmenu = NULL, *forcespectatemenu = NULL;

void refreshsopmenu(void *menu, bool init)
{
Expand All @@ -1753,7 +1750,28 @@ void refreshsopmenu(void *menu, bool init)
copystring(m.name, colorname(players[i]));
string kbr;
if(getalias("_kickbanreason")!=NULL) formatstring(kbr)(" [ %s ]", getalias("_kickbanreason")); // leading space!
formatstring(m.cmd)("%s %d%s", menu==kickmenu ? "kick" : (menu==banmenu ? "ban" : (menu==forceteammenu ? "forceteam" : "giveadmin")), i, (menu==kickmenu||menu==banmenu)?(strlen(kbr)>8?kbr:" NONE"):""); // 8==3 + "format-extra-chars"
if(menu == forcespectatemenu)
{
if(servstate.mastermode == MM_MATCH || servstate.mastermode == MM_PRIVATE)
{
if(m_teammode)
{
formatstring(m.cmd)("tempalias _forcespectcn %d; showmenu [Force to spectator team]", i);
}
else
{
formatstring(m.cmd)("forceteam %d 4", i);
}
}
else
{
formatstring(m.cmd)("forceteam %d 4", i);
}
}
else
{
formatstring(m.cmd)("%s %d%s", menu==kickmenu ? "kick" : (menu==banmenu ? "ban" : ((menu==forceteammenu) ? "forceteam" : "giveadmin")), i, (menu==kickmenu||menu==banmenu)?(strlen(kbr)>8?kbr:" NONE"): ""); // 8==3 + "format-extra-chars"
}
menuitemmanual(menu, m.name, m.cmd);
}
}
Expand Down
4 changes: 4 additions & 0 deletions source/src/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ void consolekey(int code, bool isdown, SDL_Keymod mod)
scrolldoc(4);
break;

case SDLK_F12:
screenshot(NULL);
break;

case SDL_AC_BUTTON_WHEELUP:
case SDLK_UP:
if(histpos > history.length()) histpos = history.length();
Expand Down
3 changes: 3 additions & 0 deletions source/src/editing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ VARFP(showeditingsettings, 0, 0, 3, { if(showeditingsettings){ toucheditingsetti

void toggleedit(bool force)
{
if(watchingdemo) return; // do not allow editing while watching a demo. * add message that editing is not allowed while watching demo?? *
if(player1->state==CS_DEAD) return; // do not allow dead players to edit to avoid state confusion
if(!force && !editmode && !allowedittoggle()) return; // not in most multiplayer modes
if(player1->state == CS_SPECTATE)
Expand Down Expand Up @@ -79,6 +80,8 @@ void toggleedit(bool force)
if(editing && player1->onladder) player1->onladder = false;
if(editing && (player1->weaponsel->type == GUN_SNIPER && ((sniperrifle *)player1->weaponsel)->scoped)) ((sniperrifle *)player1->weaponsel)->onownerdies(); // or ondeselecting()
if(editing && (player1->weaponsel->type == GUN_GRENADE) && ((grenades *)player1->weaponsel)->state < GST_THROWING) ((grenades *)player1->weaponsel)->onownerdies();
/*prevents flag from being dropped when entering edit mode, allowing flag movement to another position when testing with the flag is needed
if(editing && m_flags_) tryflagdrop(false);*/
if(!force) addmsg(SV_EDITMODE, "ri", editing);
}

Expand Down
18 changes: 12 additions & 6 deletions source/src/entities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ void rendermapmodels()
{
mapmodelinfo *mmi = getmminfo(e.attr2);
if(!mmi) continue;
rendermodel(mmi->name, ANIM_MAPMODEL|ANIM_LOOP, e.attr4, 0, vec(e.x, e.y, S(e.x, e.y)->floor + mmi->zoff + float(e.attr3) / ENTSCALE5), e.attr6, float(e.attr1) / ENTSCALE10, float(e.attr5) / ENTSCALE10, 10.0f, 0, NULL, NULL, mmi->scale);
float model_z = S(e.x, e.y)->floor + mmi->zoff + float(e.attr3) / ENTSCALE5;
if(player1->spectatemode == SM_OVERVIEW)
{
float model_top_z = model_z + mmi->h;
if(model_top_z > clmapdims.maxceil - 10) continue;
}
rendermodel(mmi->name, ANIM_MAPMODEL|ANIM_LOOP, e.attr4, 0, vec(e.x, e.y, model_z), e.attr6, float(e.attr1) / ENTSCALE10, float(e.attr5) / ENTSCALE10, 10.0f, 0, NULL, NULL, mmi->scale);
}
}
}
Expand Down Expand Up @@ -652,13 +658,13 @@ void checkitems(playerent *d)
if(OUTBORD(f.pos.x, f.pos.y)) continue;
if(f.state==CTFF_DROPPED) // 3d collision for dropped ctf flags
{
if(objcollide(d, f.pos, 2.5f, 8.0f)) trypickupflag(i, d);
if(objcollide(d, f.pos, 2.5f, 6.5f)) trypickupflag(i, d);
}
else // simple 2d collision
else // 3d collision for flag in base
{
vec v = f.pos;
v.z = S(int(v.x), int(v.y))->floor + eyeheight;
if(d->o.dist(v)<2.5f) trypickupflag(i, d);
vec flagpos = f.pos;
flagpos.z = S(int(f.pos.x), int(f.pos.y))->floor;
if(objcollide(d, flagpos, 2.5f, 6.5f)) trypickupflag(i, d);
}
}
if(d==player1)
Expand Down
2 changes: 1 addition & 1 deletion source/src/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ enum { ENT_PLAYER = 0, ENT_BOT, ENT_CAMERA, ENT_BOUNCE };
enum { CS_ALIVE = 0, CS_DEAD, CS_SPAWNING, CS_LAGGED, CS_EDITING, CS_SPECTATE };
enum { CR_DEFAULT = 0, CR_MASTER, CR_ADMIN, CR_OWNER, CR_NUM };
enum { SM_NONE = 0, SM_DEATHCAM, SM_FOLLOW1ST, SM_FOLLOW3RD, SM_FOLLOW3RD_TRANSPARENT, SM_FLY, SM_OVERVIEW, SM_NUM };
enum { FPCN_VOID = -4, FPCN_DEATHCAM = -2, FPCN_FLY = -2, FPCN_OVERVIEW = -1 };
enum { FPCN_VOID = -4, FPCN_DEATHCAM, FPCN_FLY, FPCN_OVERVIEW };

class physent
{
Expand Down
19 changes: 18 additions & 1 deletion source/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ void cleanup(char *msg) // single program exit point;

VAR(resetcfg, 0, 0, 1);

VARP(soundfocus, 0, 0, 1);

int lastsoundvol = 0;

void quit() // normal exit
{
if(lastsoundvol > 0) soundvol = lastsoundvol;
if(clientlogfile) clientlogfile->fflush();
const char *onquit = getalias("onQuit");
setcontext("hook", "onQuit");
Expand Down Expand Up @@ -1086,12 +1091,23 @@ void checkinput()
case SDL_WINDOWEVENT_FOCUS_GAINED: // window has gained keyboard focus
EVENTDEBUG(concatstring(eb, " SDL_WINDOWEVENT_FOCUS_GAINED"));
shouldgrab = true;
if(!soundfocus && lastsoundvol > 0)
{
soundvol = lastsoundvol;
audiomgr.setlistenervol(soundvol);
}
break;

case SDL_WINDOWEVENT_FOCUS_LOST: // window has lost keyboard focus
EVENTDEBUG(concatstring(eb, " SDL_WINDOWEVENT_FOCUS_LOST"));
shouldgrab = false;
focused = -1;
if(!soundfocus)
{
lastsoundvol = soundvol;
soundvol = 0;
audiomgr.setlistenervol(soundvol);
}
break;
}
break;
Expand Down Expand Up @@ -1559,14 +1575,15 @@ int main(int argc, char **argv)
audiomgr.initsound();

initlog("cfg");
extern void *scoremenu, *servmenu, *searchmenu, *serverinfomenu, *kickmenu, *banmenu, *forceteammenu, *giveadminmenu, *docmenu, *applymenu, *downloaddemomenu;
extern void *scoremenu, *servmenu, *searchmenu, *serverinfomenu, *kickmenu, *banmenu, *forceteammenu, *forcespectatemenu, *giveadminmenu, *docmenu, *applymenu, *downloaddemomenu;
scoremenu = addmenu("score", "columns", false, renderscores, NULL, false, true);
servmenu = addmenu("server", NULL, true, refreshservers, serverskey);
searchmenu = addmenu("search", NULL, true, refreshservers, serverskey);
serverinfomenu = addmenu("serverinfo", "extended server information (F5: refresh)", true, refreshservers, serverinfokey);
kickmenu = addmenu("kick player", NULL, true, refreshsopmenu);
banmenu = addmenu("ban player", NULL, true, refreshsopmenu);
forceteammenu = addmenu("force team", NULL, true, refreshsopmenu);
forcespectatemenu = addmenu("force spectate", NULL, true, refreshsopmenu);
giveadminmenu = addmenu("give admin", NULL, true, refreshsopmenu);
docmenu = addmenu("reference", NULL, true, renderdocmenu);
applymenu = addmenu("apply", "apply changes now?", true, refreshapplymenu);
Expand Down
7 changes: 4 additions & 3 deletions source/src/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ struct mitemtextinput : mitemtext
virtual void key(int code, bool isdown)
{
if(input.key(code)) modified = true;
if(action && code == SDLK_RETURN && modified && parent->items.find(this) != parent->items.length() - 1)
if(action && (code == SDLK_RETURN || code == SDLK_KP_ENTER) && modified && parent->items.find(this) != parent->items.length() - 1)
{
modified = false;
execaction(input.buf);
Expand Down Expand Up @@ -577,6 +577,8 @@ struct mitemslider : mitem
else if(code == SDLK_RIGHT) slide(true);
}

virtual int select() { return -1; }

virtual void init()
{
const char *p = valueexp;
Expand Down Expand Up @@ -1270,14 +1272,13 @@ bool menukey(int code, bool isdown, SDL_Keymod mod)
case SDLK_F12:
if(curmenu->allowinput)
{
extern void screenshot(const char *filename);
screenshot(NULL);
}
break;
}
if(!curmenu->allowinput || !curmenu->items.inrange(menusel)) return false;
mitem &m = *curmenu->items[menusel];
if(code==SDLK_RETURN || code==SDLK_KP_ENTER || code==SDLK_SPACE || code==SDL_AC_BUTTON_LEFT || code==SDL_AC_BUTTON_MIDDLE)
if(code==SDLK_RETURN || code==SDLK_KP_ENTER || (code==SDLK_SPACE && m.mitemtype != mitem::TYPE_TEXTINPUT) || code==SDL_AC_BUTTON_LEFT || code==SDL_AC_BUTTON_MIDDLE)
{
if(!m.greyedout && m.select() != -1) audiomgr.playsound(S_MENUENTER, SP_HIGHEST);
return true;
Expand Down
Loading