Counter-Strike: Added intermission logic.

This commit is contained in:
Marco Cawthorne 2020-04-26 20:57:13 +02:00
parent 9ace996ada
commit 92aac3489f
5 changed files with 41 additions and 11 deletions

View file

@ -271,22 +271,19 @@ CSMultiplayerRules::TimerUpdate(void)
if (g_cs_gamestate != GAME_OVER) {
if (cvar("mp_timelimit") > 0) {
if (time >= (cvar("mp_timelimit") * 60)) {
TimerBegin(5, GAME_OVER);
IntermissionStart();
g_cs_gamestate = GAME_OVER;
}
}
}
if ((g_cs_gamestate == GAME_OVER) && (g_cs_gametime < 0)) {
localcmd("echo nextmap\n");
}
// Okay, this means that timelimit is not the only deciding factor
if (autocvar_mp_winlimit > 0 && g_cs_gamestate != GAME_OVER) {
// It really doesn't matter who won. Do some logging perhaps?
if (g_cs_roundswon_ct == autocvar_mp_winlimit) {
TimerBegin(5, GAME_OVER);
IntermissionStart();
} else if (g_cs_roundswon_t == autocvar_mp_winlimit) {
TimerBegin(5, GAME_OVER);
IntermissionStart();
}
}

View file

@ -17,6 +17,13 @@
void
Game_Input(void)
{
CGameRules rules = (CGameRules)g_grMode;
if (rules.m_iIntermission) {
rules.IntermissionEnd();
return;
}
if (input_buttons & INPUT_BUTTON0) {
Weapons_Primary();
} else if (input_buttons & INPUT_BUTTON4) {

View file

@ -14,7 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*QUAKED weapon_mp5 (0 0 1) (-16 -16 0) (16 16 32)
/*QUAKED weapon_mp5navy (0 0 1) (-16 -16 0) (16 16 32)
"model" "models/w_mp5.mdl"
COUNTER-STRIKE (1999) ENTITY
@ -251,7 +251,7 @@ w_mp5_hudpic(int selected, vector pos, float a)
weapon_t w_mp5 =
{
"mp5",
"mp5navy",
ITEM_MP5,
0,
2,

View file

@ -243,7 +243,7 @@ w_para_hudpic(int selected, vector pos, float a)
weapon_t w_para =
{
"para",
"m249",
ITEM_PARA,
0,
15,
@ -267,7 +267,7 @@ weapon_t w_para =
#ifdef SERVER
void
weapon_para(void)
weapon_m249(void)
{
Weapons_InitItem(WEAPON_PARA);
}

View file

@ -20,6 +20,32 @@ void Decals_Init(void);
void Weapons_Init(void)
{
/* in the future we'll have no internal weapon table, then this will fill
* one up... */
/*searchhandle sh;
filestream fh;
string line;
sh = search_begin("scripts/weapon_*.txt", TRUE, TRUE);
for (int i = 0; i < search_getsize(sh); i++) {
fh = fopen(search_getfilename(sh, i), FILE_READ);
if (fh < 0) {
continue;
}
while ((line = fgets(fh))) {
int w = tokenize(line);
switch (argv(0)) {
case "name":
break;
case "slot":
break;
case "slot_pos":
break;
}
}
fclose(fh);
}*/
for (int i = 0; i < g_weapons.length; i++) {
if (g_weapons[i].precache != __NULL__) {
g_weapons[i].precache();