From bccddaa7fd9f75cf165db40d0ed07a6e1069c0ac Mon Sep 17 00:00:00 2001 From: archive Date: Sun, 14 Mar 1999 00:00:00 +0000 Subject: [PATCH] as released 1999-03-14 --- CHANGES | 91 ++ LICENSE.TXT | 91 ++ README | 46 +- a_cmds.c | 31 +- a_game.c | 281 +++-- a_game.h | 7 +- a_radio.c | 37 +- a_team.c | 29 +- g_cmds.c | 63 +- g_combat.c | 148 ++- g_items.c | 66 +- g_local.h | 16 +- g_main.c | 2 + g_save.c | 35 +- g_spawn.c | 8 +- g_svcmds.c | 14 +- g_weapon.c | 9 + p_client.c | 3454 ++++++++++++++++++++++++++------------------------- p_view.c | 11 +- p_weapon.c | 1329 +++++++++++--------- 20 files changed, 3207 insertions(+), 2561 deletions(-) create mode 100644 LICENSE.TXT diff --git a/CHANGES b/CHANGES index 189601f..5bb2003 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,94 @@ +CHANGES FROM ACTION 1.5 TO ACTION 1.51 + +o Now remembers how many times reload key was pressed. + +o Shotgun reduced to Action Quake 1.0c levels beyond distance of 450. + +o Bandolier/weapon-dropping bug fixed. + +o Empty pistols animation setup improved. + +o Firing sequence for dual pistols fixed (firing was simultaneously +before). + +o Various grenade-related fixes. + +o Knife slashing damage changed (should be more damaging now). + +o You can now switch weapons while bandaging again. + +o Leg damage (from falling) no longer taken while in god mode. + +o Spelling of "trepanned" fixed. + +o Item spawning problem that affected some old/odd maps fixed. + +o Reloading sound/speed issues fixed. + +o Point-blank knife-throwing bug fixed. + +o Blood trail fixes. + +o Death sound fixes. + +o Negative value for "tgren" server variable is treated as 0 now. + +o New server variable "skipmotd" allows you to leave out the standard +Action MOTD contents (except the two lines at the top), for people who +want really big local motd.txt files. + +o Many server variables that didn't need to be SERVERINFO (ie: appearing +in GameSpy, etc) are no longer SERVERINFO. + +o New server command "sv reloadmotd" allows you to reload the MOTD from +disk. Also, the MOTD is always reloaded at the end of each level. + +o The "playerlist" and "players" commands no longer contain frags when +"noscore" is turned on. + +o New "ininame" variable lets you change the name of your Action INI file +from "action.ini" to something else. Useful for people who run multiple +servers from the same directory tree. + +o Deathmatch mode is now forced on always, as in previous versions of +Action. This was the cause of the "failed to find special item spawn +point" error when starting a game locally on your computer. + +o Delayed kill attribution for falling damage fixes. + +o Lasersight properly follows M4 during ride-up. + +o Scoreboard cosmetic fixes. + +o Players entering the game in a teamplay game no longer generate the "enter +game" teleport effect (green flash, etc) at a spawn point. + +o Bug fixed that could cause crash when certain weird combinations of dmflags +were used (ie teams-by-skin with teamplay turned on). + +o Players can now select "classic" style firing where shots land slightly +right or left (depending on your handedness) and down from the crosshair +(see the "hand" command in the README for info). + +o The [DEAD] flag on a dead chatter's name previously didn't get tacked on +starting at the right time, so sometimes you'd see someone who appeared to +be alive (due to no [DEAD] on their name) say something but %-variables +(ie %W, %H, etc) didn't get expanded. This also caused dead people's +messages to be able to reach teammates sometimes in the moments after +dying. + +o After a team round has ended, all players (including players who +survived) can now see the scoreboard as if they were dead, to see who else +survived the round. + +o The join-a-team menu now, if both teams have the same number of players, +defaults to the team that's losing (instead of defaulting to the first +team). + +o Optimization in SetIDView and DetermineViewedTeammate suggested by +hal[9k]. + + CHANGES FROM ACTION 1.1b2 TO ACTION 1.5 diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 0000000..6d93dc2 --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,91 @@ + LIMITED PROGRAM SOURCE CODE LICENSE + + This Limited Program Source Code License (the "Agreement") is between Id Software, Inc., a Texas corporation, (hereinafter "Id Software") and Licensee (as defined below) and is made effective beginning on the date you, the Licensee, download the Code, as defined below, (the "Effective Date"). BY DOWNLOADING THE CODE, AS DEFINED BELOW, YOU, THE LICENSEE, AGREE TO ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU SHOULD READ THIS AGREEMENT CAREFULLY BEFORE DOWNLOADING THE CODE. EVERY PERSON IN POSSESSION OF AN AUTHORIZED COPY, AS DEFINED BELOW, OF THE CODE SHALL BE SUBJECT TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. + + R E C I T A L S + +WHEREAS, Id Software is the owner and developer of the computer software program source code accompanied by this Agreement (the "Code"); + +WHEREAS, Id Software desires to license certain limited non-exclusive rights regarding the Code to Licensee; and + +WHEREAS, Licensee desires to receive a limited license for such rights. + + T E R M S A N D C O N D I T I O N S + + NOW, THEREFORE, for and in consideration of the mutual premises contained herein and for other good and valuable consideration, the receipt and sufficiency of which is hereby acknowledged, the undersigned parties do hereby agree as follows: + +1. Definitions. The parties hereto agree the following definitions shall apply to this Agreement: + + a. "Authorized Copy" shall mean a copy of the Code obtained by Authorized Means, as defined below. A copy of the Code is not an "Authorized Copy" unless it is accompanied by a copy of this Agreement and obtained by Authorized Means. A Modified Copy, as defined below, is not an Authorized Copy; + + b. "Authorized Means" shall mean obtaining an Authorized Copy only by downloading the Authorized Copy from Id Software's Internet web site or from another web site authorized or approved by Id Software for such purposes or by obtaining an Authorized Copy by electronic means via the Internet; + + c. "Code" shall mean the computer software program source code which accompanies this Agreement and includes Code included within any Modified Copy and which is the code that constitutes the Authorized Copy; + + d. "Game" shall mean QUAKE II; + + e. "Licensee" shall mean you, the person who is in possession of an Authorized Copy by Authorized Means; and + + f. "Modified Copy" shall mean a copy of the Code first obtained by Authorized Means which is subsequently modified by Licensee, as provided in paragraph 2. below. + +2. Grant of Rights. Subject to the terms and provisions of this Agreement, Id Software hereby grants to Licensee and Licensee hereby accepts, a limited, world-wide (except as otherwise provided herein), non-exclusive, non-transferable, and non-assignable license to: (i) use the Authorized Copy and the Modified Copy, as defined above, for the development by Licensee of extra levels operable with the Game (the "Extra Levels"); (ii) incorporate all or a portion of the Authorized Copy and the Modified Copy within the Extra Levels; (iii) distribute by way of a sublicense limited by the terms of this Agreement, free of charge and at no cost, the Authorized Copy and the Modified Copy to the extent such Modified Copy and such Authorized Copy, or a portion thereof, is included within the Extra Levels; (iv) distribute by way of a sublicense limited by the terms of this Agreement, free of charge and at no cost, by electronic transmission via the Internet only the Authorized Copy without any alteration or modification along with a copy of this Agreement which must always accompany the Authorized Copy; (v) modify the Authorized Copy in order to create a Modified Copy, as defined above; and (vi) distribute the Modified Copy by way of a sublicense limited by the terms of this Agreement, free of charge and at no cost, by electronic transmission via the Internet only. Each person or entity who/which receives a copy of the Code shall be subject to the terms of this Agreement but, no rights are granted to any person or entity who/which obtains, receives, or is in possession of any copy of the Code by other than Authorized Means. + +3. Reservation of Rights and Prohibitions. Id Software expressly reserves all rights not granted herein. Licensee shall not make any use of the trademarks relating to the Game or Id Software (the "Trademarks"). Any use by Licensee of the Authorized Copy or the Modified Copy not expressly permitted in paragraph 2. above is expressly prohibited and any such unauthorized use shall constitute a material breach of this Agreement by Licensee. Any use of the Code, whether included within a Modified Copy or otherwise, and/or the Authorized Copy not permitted in this Agreement shall constitute an infringement or violation of Id Software's copyright in the Code. Licensee shall not copy, reproduce, manufacture or distribute (free of charge or otherwise) the Authorized Copy or the Modified Copy in any tangible media, including, without limitation, a CD ROM. Licensee shall not commercially exploit by sale, lease, rental or otherwise the Authorized Copy or the Modified Copy whether included within Extra Levels or otherwise. Licensee shall not commercially exploit by sale, lease, rental or otherwise any Extra Levels developed by the use of the Code, whether in whole or in part. Licensee is not receiving any rights hereunder regarding the Game, the Trademarks or any audio-visual elements, artwork, sound, music, images, characters, or other element of the Game. Licensee may modify the Authorized Copy in order to create a Modified Copy, as noted above, but all sublicensees who receive the Modified Copy shall not receive any rights to commercially exploit or to make any other use of the Code included therein except the right to use such Code for such sublicensee's personal entertainment. By way of example and not exclusion, a sublicensee for the Modified Copy shall not further modify the Code within the Modified Copy. Only the Licensee who obtains the Code by Authorized Means shall be permitted to modify such Code on the terms as described in this Agreement. + +4. Additional Obligations. In addition to the obligations of Licensee otherwise set forth in this Agreement, during the Term, and thereafter where specified, Licensee agrees that: + + a. Licensee will not attack or challenge the ownership by Id Software of the Code, the Authorized Copy, the Game, the Trademarks, or any copyright, patent or trademark or other intellectual property right related thereto and Licensee will not attack or challenge the validity of the license granted hereunder during the Term or thereafter; and + + b. Licensee will promptly inform Id Software of any unauthorized use of the Code, the Authorized Copy, the Trademarks, or the Game, or any portions thereof, and will reasonably assist Id Software in the enforcement of all rights Id Software may have against such unauthorized users. + +5. Ownership. Title to and all ownership rights in and to the Code, whether included within the Modified Copy, the Authorized Copy or otherwise, the Game, the Authorized Copy, and the Trademarks and the copyrights, trade secrets, trademarks, patents and all other intellectual property rights related thereto shall remain with Id Software which shall have the exclusive right to protect the same by copyright or otherwise. Licensee shall have no ownership rights in or to the Game, the Code, the Authorized Copy or the Trademarks. Licensee acknowledges that Licensee, by this Agreement, is only receiving a limited license to use the Authorized Copy, as specified in paragraph 2. of this Agreement. + +6. Compliance with Applicable Laws. In exercising Licensee's limited rights hereunder, Licensee shall comply with all applicable laws, [including, without limitation, 22 U.S.C., section 2778 and 22 U.S.C. C.F.R. Parts 120-130 (1995)] regulations, ordinances and statutes, including, but not limited to, the import/export laws and regulations of the United States and its governmental and regulatory agencies (including, without limitation, the Bureau of Export Administration and the U.S. Department of Commerce) and all applicable international treaties and laws. + +7. Term and Termination. + + a. The term of this Agreement and the license granted herein begins on the Effective Date and shall expire, without notice, on a date one (1) calendar year from the Effective Date (the "Term"). + + b. Either party may terminate this Agreement, for any reason or no reason, on thirty (30) days written notice to the other party. Termination will be effective on the thirtieth (30th) day following delivery of the notice of termination. Notwithstanding anything to the contrary herein, this Agreement shall immediately terminate, without the requirement of any notice from Id Software to Licensee, upon the occurrence of any of the following "Terminating Events": (i) if Licensee files a petition in bankruptcy; (ii) if Licensee makes an assignment for the benefit of creditors; (iii) if any bankruptcy proceeding or assignment for benefit of creditors is commenced against Licensee and not dismissed within sixty (60) days after the date of its commencement; (iv) the insolvency of Licensee; or (v) a breach, whether material or otherwise, of this Agreement by Licensee. Upon the occurrence of a Terminating Event, this Agreement and any and all rights hereunder shall terminate without prejudice to any rights or claims Id Software may have, and all rights granted hereunder shall revert, without notice, to and be vested in Id Software. + + c. Termination or expiration of this Agreement shall not create any liability against Id Software and shall not relieve Licensee from any liability which arises prior to termination or expiration. Upon expiration or earlier termination of this Agreement, Licensee shall have no further right to exercise the rights licensed hereunder or otherwise acquired in relation to this Agreement. + +8. Licensee's Warranties. Licensee warrants and represents that: (i) Licensee has full legal rights and authority to enter into and become bound by the terms of this Agreement; (ii) Licensee has full legal rights and authority to perform Licensee?s obligations hereunder; (iii) Licensee will comply, at all times during the Term, with all applicable laws, as set forth hereinabove; (iv) all modifications which Licensee performs on the Code in order to create the Modified Copy and all non-Id Software property included within Extra Levels shall not infringe against or misappropriate any third party rights, including, without limitation, copyrights and trade secrets; and (v) the use or non-use of all modifications which Licensee performs on the Code in order to create the Modified Copy and all non-Id Software property included within Extra Levels shall not infringe against or misappropriate any third party rights, including, without limitation, copyrights and trade secrets. + +9. Indemnification. Licensee hereby agrees to indemnify, hold harmless and defend Id Software and Id Software's predecessors, successors, assigns, officers, directors, shareholders, employees, agents, representatives, licensees (but not including Licensee), sublicensees, distributors, attorneys and accountants (collectively, the "Id Related Parties") from and against any and all "Claims", which shall mean all damages, claims, losses, causes of action, liabilities, lawsuits, judgments and expenses (including, without limitation, reasonable attorneys' fees and expenses) arising from, relating to or in connection with (i) a breach of this Agreement by Licensee and/or (ii) Licensee's use or non-use of the Code, whether the Authorized Copy or whether a portion of the Code as may be included within the Modified Copy or within Extra Levels. Id Software agrees to notify Licensee of any such Claims within a reasonable time after Id Software learns of same. Licensee, at its own expense, shall defend Id Software and the Id Related Parties from and against any and all Claims. Id Software and the Id Related Parties reserve the right to participate in any defense of the Claims with counsel of their choice, and at their own expense. In the event Licensee fails to provide a defense, then Licensee shall be responsible for paying the attorneys' fees and expenses incurred by Id Software and the Id Related Parties regarding the defense of the Claims. Id Software and the Id Related Parties, as applicable, agree to reasonably assist in the defense of the Claims. No settlement by Licensee of any Claims shall be valid unless Licensee receives the prior written consent of Id Software and the Id Related Parties, as applicable, to any such settlement, with consent may be withheld in Id Software's and the Id Related Parties' sole discretion. + +10. Limitation of Liability. UNDER NO CIRCUMSTANCES SHALL ID SOFTWARE BE LIABLE TO LICENSEE FOR ACTUAL, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES OR ANY OTHER DAMAGES, WHETHER OR NOT ID SOFTWARE RECEIVES NOTICE OF ANY SUCH DAMAGES. + +11. Disclaimer of Warranties. ID SOFTWARE EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH REGARD TO THE CODE, THE AUTHORIZED COPY AND OTHERWISE. + +12. Goodwill. Licensee recognizes the great value of the goodwill associated with the Game and the Trademarks, and acknowledges that such goodwill, now existing and hereafter created, exclusively belongs to Id Software and that the Trademarks have acquired a secondary meaning in the mind of the public. + +13. Remedies. In the event of a breach of this Agreement by Id Software, Licensee's sole remedy shall be to terminate this Agreement by delivering written notice of termination to Id Software. In the event of a breach by Licensee of this Agreement, Id Software may pursue the remedies to which Id Software is entitled under applicable law and this Agreement. Licensee agrees that Licensee's unauthorized use of the Authorized Copy would immediately and irreparably damage Id Software, and in the event of such threatened or actual unauthorized use, Id Software shall be entitled to an injunctive order appropriately restraining and/or prohibiting such unauthorized use without the necessity of Id Software posting bond or other security. Pursuit of any remedy by Id Software shall not constitute a waiver of any other right or remedy of Id Software under this Agreement or under applicable law. + +14. Choice of Law, Venue and Service of Process. This Agreement shall be construed in accordance with the laws of the State of Texas and applicable United States federal law and all claims and/or lawsuits in connection with this Agreement must be brought in Dallas County, Texas where exclusive venue shall lie. Licensee hereby agrees that service of process by certified mail to the address set forth below, with return receipt requested, shall constitute valid service of process upon Licensee. If for any reason Licensee has moved or cannot be validly served, then Licensee appoints the Secretary of State of the state of Texas to accept service of process on Licensee's behalf. + +15. Delivery of Notices. Unless otherwise directed in writing by the parties, all notices given hereunder shall be sent to the last known address of addressee. All notices, requests, consents and other communications under this Agreement shall be in writing and shall be deemed to have been delivered on the date personally delivered or on the date deposited in the United States Postal Service, postage prepaid, by certified mail, return receipt requested, or telegraphed and confirmed, or delivered by electronic facsimile and confirmed. Any notice to Id Software shall also be sent to its counsel: D. Wade Cloud, Jr., Hiersche, Martens, Hayward, Drakeley & Urbach, P.C., 15303 Dallas Parkway, Suite 700, LB 17, Dallas, Texas 75248. + +16. No Partnership, Etc. This Agreement does not constitute and shall not be construed as constituting a partnership or joint venture between Id Software and Licensee. Neither party shall have any right to obligate or bind the other party in any manner whatsoever, and nothing herein contained shall give, or is intended to give, any rights of any kind to any third persons. + +17. Entire agreement. This Agreement constitutes the entire understanding between Licensee and Id Software regarding the subject matter hereof. Each and every clause of this Agreement is severable from the whole and shall survive unless the entire Agreement is declared unenforceable. No prior or present agreements or representations between the parties hereto regarding the subject matter hereof shall be binding upon the parties hereto unless incorporated in this Agreement. No modification or change in this Agreement shall be valid or binding upon the parties hereto unless in writing and executed by the parties to be bound thereby. + +18. Assignment. This Agreement shall bind and inure to the benefit of Id Software, its successors and assigns, and Id Software may assign its rights hereunder, in Id Software's sole discretion. This Agreement is personal to Licensee, and Licensee shall not assign, transfer, convey nor franchise its rights granted hereunder. As provided above, Licensee may sublicense Licensee's limited rights herein by transferring the Authorized Copy by Authorized Means. As noted, each sublicensee in possession of a copy of the Authorized Copy shall be subject to the terms and conditions of this Agreement. + +19. Survival. The following provisions shall survive the expiration or earlier termination of this Agreement: paragraphs 5., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 19., 20.a. and 20.b. + +20. Miscellaneous. + + a. All captions in this Agreement are intended solely for the convenience of the parties, and none shall effect the meaning or construction of any provision. + + b. The terms and conditions of this Agreement have been negotiated fully and freely among the parties. Accordingly, the preparation of this Agreement by counsel for a given party will not be material to the construction hereof, and the terms of this Agreement shall not be strictly construed against such party. + +BY DOWNLOADING THE CODE, AS DEFINED ABOVE, YOU, THE LICENSEE, AGREE TO ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. + + +February 12, 1998 + + +LIMITED PROGRAM SOURCE CODE LICENSE PAGE 1 + + diff --git a/README b/README index c770263..654bbf0 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -SERVER/PLAYER DOCUMENTATION FOR ACTION 1.5 +SERVER/PLAYER DOCUMENTATION FOR ACTION 1.51 ACTION-SPECIFIC SERVER VARIABLES @@ -18,6 +18,10 @@ motd_time: the number of seconds that the initial MOTD should remain on the player's screen. This number is rounded up to the nearest 2-second interval (default = 2). +skipmotd: allows you to skip all but the top two lines of the normal +Action MOTD, for server operators who want large motd.txt files +(default = 0 [don't skip]). + weapons: the maximum number of "unique weapons" a player can carry (the bandolier adds 1 to a player's max carry) (default = 1). @@ -59,6 +63,12 @@ nohud: if set to 1, the standard HUD (health, ammo, etc) is disabled for all players. This can allow you to record better-looking demos of staged scenes (default = 0). +ininame: if set, changes the name of the Action INI file from "action.ini" +to whatever you specify. The file must always be located in your Action +game directory. This should be used on the Quake2 commandline, ie: + quake2 +set game action +set ininame alternate.ini +set dedicated 1 ... +(default = "action.ini"). + ACTION-SPECIFIC PLAYER COMMANDS @@ -91,6 +101,14 @@ motd: brings up the MOTD (message of the day) again. spectator: can be set to 0 or 1 ("spectator 0", "spectator 1") to toggle being a spectator in DM games. +hand: in addition to the normal Q2 modes (0 = right-handed, 1 = +left-handed, 2 = "center"-handed), you can select "classic" style shooting +(where shots end up left/right and below the crosshair), or "classic high" +style shooting (where shots end up left/right of the crosshair). The +proper commands to select those modes are: hand "0 classic" (right-handed +classic), hand "0 classic high" (right-handed classic high), etc. Note +that the double-quotes are required. + choose: chooses a particular item or weapon as your item or weapon, without going through the menus, in teamplay (ie: "choose mp5/10 submachinegun" or "choose lasersight"). @@ -193,25 +211,27 @@ standard Q2 "dmflags" values. action/action.ini is the configuration file for map rotation and teamplay team name/model/skin setup. See the example for information on the format. -action/motd.txt, if present, will be appended to the server MOTD. +action/motd.txt, if present, will be appended to the server MOTD. The +server command "sv reloadmotd" can be used to reload it from disk at any +time, and it is also reloaded at the end of each level automatically. IP BANNING -Commands: addip, removeip, listip, writeip +Commands: sv addip, sv removeip, sv listip, sv writeip Server variables: filterban You can add or remove addresses from the IP filter list with the commands -"addip " and "removeip ". The IP address is specified in numeric dot -format, and any unspecified digits will match any value, so you can specify an -entire class C network with "addip 240.200.100", for example. "removeip" will -only remove an address specified in the exact same way. The "listip" command -will print the current list of filters. The "writeip" command will dump the -current filters to a config file, "listip.cfg" in your Action directory. You -should add a line in your normal server.cfg that does an "exec listip.cfg" to -load this file by default. IP addresses in the filter list will only be -prohibited from connecting if the "filterban" variable is set to 1 (this is the -default). +"sv addip " and "sv removeip ". The IP address is specified in +numeric dot format, and any unspecified digits will match any value, so +you can specify an entire class C network with "addip 240.200.100", for +example. "sv removeip" will only remove an address specified in the exact +same way. The "sv listip" command will print the current list of filters. +The "sv writeip" command will dump the current filters to a config file, +"listip.cfg" in your Action directory. You should add a line in your +normal server.cfg that does an "exec listip.cfg" to load this file by +default. IP addresses in the filter list will only be prohibited from +connecting if the "filterban" variable is set to 1 (this is the default). REPORTING BUGS OR MAKING COMMENTS diff --git a/a_cmds.c b/a_cmds.c index 7f97e9d..f2f872c 100644 --- a/a_cmds.c +++ b/a_cmds.c @@ -108,9 +108,12 @@ void LaserSightThink (edict_t *self) { vec3_t start,end,endp,offset; vec3_t forward,right,up; + vec3_t angles; trace_t tr; - AngleVectors (self->owner->client->v_angle, forward, right, up); + // zucc compensate for weapon ride up + VectorAdd (self->owner->client->v_angle, self->owner->client->kick_angles, angles); + AngleVectors (/*self->owner->client->v_angle*/angles, forward, right, up); if ( self->owner->lasersight != self ) @@ -139,6 +142,12 @@ void LaserSightThink (edict_t *self) } +void Cmd_New_Reload_f( edict_t *ent ) +{ + ent->client->reload_attempts++; +} + + //+BD ENTIRE CODE BLOCK NEW // Cmd_Reload_f() // Handles weapon reload requests @@ -158,11 +167,16 @@ void Cmd_Reload_f (edict_t *ent) || ent->client->bandaging == 1 || ent->client->bandage_stopped == 1 || ent->client->weaponstate == WEAPON_ACTIVATING - || ent->client->weaponstate == WEAPON_DROPPING ) + || ent->client->weaponstate == WEAPON_DROPPING + || ent->client->weaponstate == WEAPON_FIRING ) { return; } - + + if (!ent->client->fast_reload) + ent->client->reload_attempts--; + if ( ent->client->reload_attempts < 0 ) + ent->client->reload_attempts = 0; //First, grab the current magazine max count... if ( ( ent->client->curr_weap == MK23_NUM ) @@ -385,8 +399,10 @@ void Cmd_Bandage_f ( edict_t *ent ) // zucc - check if they have a primed grenade if ( ent->client->curr_weap == GRENADE_NUM - && ( ent->client->ps.gunframe >= GRENADE_IDLE_FIRST - && ent->client->ps.gunframe <= GRENADE_IDLE_LAST ) ) + && ( ( ent->client->ps.gunframe >= GRENADE_IDLE_FIRST + && ent->client->ps.gunframe <= GRENADE_IDLE_LAST ) + || ( ent->client->ps.gunframe >= GRENADE_THROW_FIRST + && ent->client->ps.gunframe <= GRENADE_THROW_LAST ) ) ) { ent->client->ps.gunframe = 0; fire_grenade2 (ent, ent->s.origin, tv(0,0,0), GRENADE_DAMRAD, 0, 2, GRENADE_DAMRAD*2, false); @@ -502,7 +518,10 @@ void SetIDView(edict_t *ent) vec3_t forward, dir; trace_t tr; edict_t *who, *best; - float bd = 0, d; +//FIREBLADE, suggested by hal[9k] 3/11/1999 + float bd = 0.9; +//FIREBLADE + float d; int i; ent->client->ps.stats[STAT_ID_VIEW] = 0; diff --git a/a_game.c b/a_game.c index 4b9d723..c9b7426 100644 --- a/a_game.c +++ b/a_game.c @@ -34,12 +34,20 @@ void ReadConfigFile() FILE *config_file; char buf[MAX_STR_LEN]; char reading_section[MAX_STR_LEN]; + char inipath[MAX_STR_LEN]; int lines_into_section = -1; + cvar_t *ininame; - config_file = fopen(GAMEVERSION "/action.ini", "r"); + ininame = gi.cvar("ininame", "action.ini", 0); + if (ininame->string && *(ininame->string)) + sprintf(inipath, "%s/%s", GAMEVERSION, ininame->string); + else + sprintf(inipath, "%s/%s", GAMEVERSION, "action.ini"); + + config_file = fopen(inipath, "r"); if (config_file == NULL) { - gi.dprintf("Unable to read %s\n", GAMEVERSION "/action.ini"); + gi.dprintf("Unable to read %s\n", inipath); return; } @@ -163,143 +171,150 @@ void PrintMOTD(edict_t *ent) "\n"); lines = 3; - // Line for server hostname, if set - if (hostname->string && strlen(hostname->string) && strcmp(hostname->string, "unnamed")) - { - //strcat(msg_buf, "Running at: "); - strcat(msg_buf, hostname->string); - strcat(msg_buf, "\n"); - lines++; - } + if (!skipmotd->value) + { + // Line for server hostname, if set + if (hostname->string && strlen(hostname->string) && strcmp(hostname->string, "unnamed")) + { + //strcat(msg_buf, "Running at: "); + strcat(msg_buf, hostname->string); + strcat(msg_buf, "\n"); + lines++; + } + + /* + * Server-specific settings information + */ + + // Line for game type + if (teamplay->value) + { + server_type = "teamplay"; + } + else + { + if ((int)dmflags->value & DF_MODELTEAMS) + server_type = "deathmatch (teams by model)"; + else if ((int)dmflags->value & DF_SKINTEAMS) + server_type = "deathmatch (teams by skin)"; + else + server_type = "deathmatch (no teams)"; + } + sprintf(msg_buf + strlen(msg_buf), + "Game type: %s\n", + server_type); + lines++; + + // Line for frag and time limit + if ((int)fraglimit->value) + sprintf(msg_buf + strlen(msg_buf), "Frag limit: %d", (int)fraglimit->value); + else + strcat(msg_buf, "Frag limit: none"); + if ((int)timelimit->value) + sprintf(msg_buf + strlen(msg_buf), " Time limit: %d\n", (int)timelimit->value); + else + strcat(msg_buf, " Time limit: none\n"); + lines++; + + // Teamplay: 3 lines for round limit/round time limit, and menu instructions + if (teamplay->value) + { + if ((int)roundlimit->value) + sprintf(msg_buf + strlen(msg_buf), "Round limit: %d", (int)roundlimit->value); + else + strcat(msg_buf, "Round limit: none"); + if ((int)roundtimelimit->value) + sprintf(msg_buf + strlen(msg_buf), " Round time limit: %d\n", (int)roundtimelimit->value); + else + strcat(msg_buf, " Round time limit: none\n"); + lines++; + } + + // Check for weird unique items/weapons settings, and inform with a line + if ((int)unique_weapons->value != 1 || + (int)unique_items->value != 1) + { + sprintf(msg_buf + strlen(msg_buf), "Max carry of special weaps: %d items: %d\n", + (int)unique_weapons->value, (int)unique_items->value); + lines++; + } + if (tgren->value > 0 || !(ir->value)) + { + char grenade_num[32]; + if (tgren->value > 0) + sprintf(grenade_num, "%d grenade%s", + (int)tgren->value, + (int)tgren->value == 1 ? "" : "s"); + sprintf(msg_buf + strlen(msg_buf), "Bandolier w/ %s%s%s\n", + !(ir->value) ? "no IR" : "", + (tgren->value > 0 && !(ir->value)) ? " & " : "", + tgren->value > 0 ? grenade_num : ""); + lines++; + } + if (allitem->value || allweapon->value) + { + sprintf(msg_buf + strlen(msg_buf), "Players receive %s%s%s\n", + allweapon->value ? "all weapons" : "", + (allweapon->value && allitem->value) ? " & " : "", + allitem->value ? "all items" : ""); + lines++; + } + + // Teamplay: 2 lines (one blank) for menu instructions + if (teamplay->value) + { + strcat(msg_buf, "\nHit tab to open the team selection menu\n"); + lines += 2; + } + + /* + * If actionmaps, put a blank line then the maps list + */ + + // hopefully no one will run enough maps to exceed the line limit, if so, oh well... -FB + if (actionmaps->value && num_maps > 0) + { + int chars_on_line, len_mr; + + strcat(msg_buf, "\nRunning the following maps in order:\n"); + lines += 2; + + chars_on_line = 0; + for (mapnum = 0; mapnum < num_maps; mapnum++) + { + len_mr = strlen(*(map_rotation + mapnum)); + if ((chars_on_line + len_mr + 2) > 39) + { + strcat(msg_buf, "\n"); + lines++; + chars_on_line = 0; + } + strcat(msg_buf, *(map_rotation + mapnum)); + chars_on_line += len_mr; + if (mapnum < (num_maps - 1)) + { + strcat(msg_buf, ", "); + chars_on_line += 2; + } + } + + strcat(msg_buf, "\n"); + lines++; + } + + if (motd_num_lines) + { + strcat(msg_buf, "\n"); + lines++; + } + } /* - * Server-specific settings information - */ - - // Line for game type - if (teamplay->value) - { - server_type = "teamplay"; - } - else - { - if ((int)dmflags->value & DF_MODELTEAMS) - server_type = "deathmatch (teams by model)"; - else if ((int)dmflags->value & DF_SKINTEAMS) - server_type = "deathmatch (teams by skin)"; - else - server_type = "deathmatch (no teams)"; - } - sprintf(msg_buf + strlen(msg_buf), - "Game type: %s\n", - server_type); - lines++; - - // Line for frag and time limit - if ((int)fraglimit->value) - sprintf(msg_buf + strlen(msg_buf), "Frag limit: %d", (int)fraglimit->value); - else - strcat(msg_buf, "Frag limit: none"); - if ((int)timelimit->value) - sprintf(msg_buf + strlen(msg_buf), " Time limit: %d\n", (int)timelimit->value); - else - strcat(msg_buf, " Time limit: none\n"); - lines++; - - // Teamplay: 3 lines for round limit/round time limit, and menu instructions - if (teamplay->value) - { - if ((int)roundlimit->value) - sprintf(msg_buf + strlen(msg_buf), "Round limit: %d", (int)roundlimit->value); - else - strcat(msg_buf, "Round limit: none"); - if ((int)roundtimelimit->value) - sprintf(msg_buf + strlen(msg_buf), " Round time limit: %d\n", (int)roundtimelimit->value); - else - strcat(msg_buf, " Round time limit: none\n"); - lines++; - } - - // Check for weird unique items/weapons settings, and inform with a line - if ((int)unique_weapons->value != 1 || - (int)unique_items->value != 1) - { - sprintf(msg_buf + strlen(msg_buf), "Max carry of special weaps: %d items: %d\n", - (int)unique_weapons->value, (int)unique_items->value); - lines++; - } - if (tgren->value || !(ir->value)) - { - char grenade_num[32]; - if (tgren->value) - sprintf(grenade_num, "%d grenade%s", - (int)tgren->value, - (int)tgren->value == 1 ? "" : "s"); - sprintf(msg_buf + strlen(msg_buf), "Bandolier w/ %s%s%s\n", - !(ir->value) ? "no IR" : "", - (tgren->value && !(ir->value)) ? " & " : "", - tgren->value ? grenade_num : ""); - lines++; - } - if (allitem->value || allweapon->value) - { - sprintf(msg_buf + strlen(msg_buf), "Players receive %s%s%s\n", - allweapon->value ? "all weapons" : "", - (allweapon->value && allitem->value) ? " & " : "", - allitem->value ? "all items" : ""); - lines++; - } - - // Teamplay: 2 lines (one blank) for menu instructions - if (teamplay->value) - { - strcat(msg_buf, "\nHit tab to open the team selection menu\n"); - lines += 2; - } - - /* - * If actionmaps, put a blank line then the maps list - */ - - // hopefully no one will run enough maps to exceed the line limit, if so, oh well... -FB - if (actionmaps->value && num_maps > 0) - { - int chars_on_line, len_mr; - - strcat(msg_buf, "\nRunning the following maps in order:\n"); - lines += 2; - - chars_on_line = 0; - for (mapnum = 0; mapnum < num_maps; mapnum++) - { - len_mr = strlen(*(map_rotation + mapnum)); - if ((chars_on_line + len_mr + 2) > 39) - { - strcat(msg_buf, "\n"); - lines++; - chars_on_line = 0; - } - strcat(msg_buf, *(map_rotation + mapnum)); - chars_on_line += len_mr; - if (mapnum < (num_maps - 1)) - { - strcat(msg_buf, ", "); - chars_on_line += 2; - } - } - - strcat(msg_buf, "\n"); - lines++; - } - - /* - * Insert blank line & action/motd.txt contents (whole MOTD gets truncated after 30 lines) + * Insert action/motd.txt contents (whole MOTD gets truncated after 30 lines) */ if (motd_num_lines) { - strcat(msg_buf, "\n"); - lines++; if (lines < max_lines) { for (i = 0; i < motd_num_lines; i++) diff --git a/a_game.h b/a_game.h index 07efb50..325d480 100644 --- a/a_game.h +++ b/a_game.h @@ -2,7 +2,7 @@ * Include for base Action game-related things */ -#define ACTION_VERSION "1.5" +#define ACTION_VERSION "1.51" extern char team1_name[]; extern char team2_name[]; @@ -24,3 +24,8 @@ qboolean loc_CanSee(edict_t *, edict_t *); qboolean IsNeutral(edict_t *); qboolean IsFemale(edict_t *); void ParseSayText(edict_t *, char *); + +// Firing styles (where shots originate from) +#define ACTION_FIRING_CENTER 0 +#define ACTION_FIRING_CLASSIC 1 +#define ACTION_FIRING_CLASSIC_HIGH 2 diff --git a/a_radio.c b/a_radio.c index 8d82b97..3bfeb52 100644 --- a/a_radio.c +++ b/a_radio.c @@ -100,7 +100,27 @@ void DeleteFirstRadioQueueEntry(edict_t *ent) return; } - for (i = 1; i < MAX_RADIO_QUEUE_SIZE; i++) + for (i = 1; i < ent->client->resp.radio_queue_size; i++) + { + memcpy(&(ent->client->resp.radio_queue[i - 1]), + &(ent->client->resp.radio_queue[i]), + sizeof(radio_queue_entry_t)); + } + + ent->client->resp.radio_queue_size--; +} + +void DeleteRadioQueueEntry(edict_t *ent, int entry_num) +{ + int i; + + if (ent->client->resp.radio_queue_size <= entry_num) + { + gi.dprintf("DeleteRadioQueueEntry: attempt to delete out of range queue entry\n"); + return; + } + + for (i = entry_num + 1; i < ent->client->resp.radio_queue_size; i++) { memcpy(&(ent->client->resp.radio_queue[i - 1]), &(ent->client->resp.radio_queue[i]), @@ -161,6 +181,7 @@ void RadioThink(edict_t *ent) { char snd_play_cmd[512]; edict_t *from; + int check; from = ent->client->resp.radio_queue[0].from_player; @@ -177,6 +198,15 @@ void RadioThink(edict_t *ent) strcpy(ent->client->resp.radio_queue[0].soundfile, RADIO_DEATH_MALE); ent->client->resp.radio_queue[0].length = RADIO_DEATH_MALE_LEN; } + + for (check = 1; check < ent->client->resp.radio_queue_size; check++) + { + if (ent->client->resp.radio_queue[check].from_player == from) + { + DeleteRadioQueueEntry(ent, check); + check--; + } + } } sprintf(snd_play_cmd, "play %s", ent->client->resp.radio_queue[0].soundfile); @@ -455,7 +485,10 @@ edict_t *DetermineViewedTeammate(edict_t *ent) vec3_t forward, dir; trace_t tr; edict_t *who, *best; - float bd = 0, d; +//FIREBLADE, suggested by hal[9k] 3/11/1999 + float bd = 0.9; +//FIREBLADE + float d; int i; AngleVectors(ent->client->v_angle, forward, NULL, NULL); diff --git a/a_team.c b/a_team.c index 71c0d72..ef8b409 100644 --- a/a_team.c +++ b/a_team.c @@ -581,7 +581,11 @@ int UpdateJoinMenu(edict_t *ent) return TEAM2; else if (num2 > num1) return TEAM1; - else + else if (team1_score > team2_score) + return TEAM2; + else if (team2_score > team1_score) + return TEAM1; + else return TEAM1; } @@ -1075,7 +1079,7 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) if (ent->client->scoreboardnum == 1) { - int team, len; + int team, len, deadview; int sorted[TEAM_TOP][MAX_CLIENTS]; int sortedscores[TEAM_TOP][MAX_CLIENTS]; int score, total[TEAM_TOP], totalscore[TEAM_TOP]; @@ -1083,6 +1087,10 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) int stoppedat[TEAM_TOP]; int name_pos[TEAM_TOP]; + deadview = (ent->solid == SOLID_NOT || + ent->deadflag == DEAD_DEAD || + !team_round_going); + ent->client->ps.stats[STAT_TEAM_HEADER] = gi.imageindex ("tag3"); total[TEAM1] = total[TEAM2] = totalalive[TEAM1] = totalalive[TEAM2] = @@ -1121,7 +1129,8 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) sortedscores[team][j] = score; totalscore[team] += score; total[team]++; - if (cl_ent->solid != SOLID_NOT) + if (cl_ent->solid != SOLID_NOT && + cl_ent->deadflag != DEAD_DEAD) totalalive[team]++; } @@ -1183,7 +1192,8 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) { cl = &game.clients[sorted[TEAM1][i]]; cl_ent = g_edicts + 1 + sorted[TEAM1][i]; - if (cl_ent->solid != SOLID_NOT) + if (cl_ent->solid != SOLID_NOT && + cl_ent->deadflag != DEAD_DEAD) totalaliveprinted[TEAM1]++; // AQ truncates names at 12, not sure why, except maybe to conserve scoreboard @@ -1192,7 +1202,7 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) sprintf(string+strlen(string), "xv 0 yv %d string%s \"%s\" ", 42 + i * 8, - (ent->solid == SOLID_NOT) ? (cl_ent->solid == SOLID_NOT ? "" : "2") : "", + deadview ? (cl_ent->solid == SOLID_NOT ? "" : "2") : "", game.clients[sorted[TEAM1][i]].pers.netname); } @@ -1200,7 +1210,8 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) { cl = &game.clients[sorted[TEAM2][i]]; cl_ent = g_edicts + 1 + sorted[TEAM2][i]; - if (cl_ent->solid != SOLID_NOT) + if (cl_ent->solid != SOLID_NOT && + cl_ent->deadflag != DEAD_DEAD) totalaliveprinted[TEAM2]++; // AQ truncates names at 12, not sure why, except maybe to conserve scoreboard @@ -1209,7 +1220,7 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) sprintf(string+strlen(string), "xv 160 yv %d string%s \"%s\" ", 42 + i * 8, - (ent->solid == SOLID_NOT) ? (cl_ent->solid == SOLID_NOT ? "" : "2") : "", + deadview ? (cl_ent->solid == SOLID_NOT ? "" : "2") : "", game.clients[sorted[TEAM2][i]].pers.netname); } @@ -1217,7 +1228,7 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) } // Print remaining players if we ran out of room... - if (ent->solid != SOLID_NOT) // live player viewing scoreboard... + if (!deadview) // live player viewing scoreboard... { if (stoppedat[TEAM1] > -1) { @@ -1243,7 +1254,7 @@ void A_ScoreboardMessage (edict_t *ent, edict_t *killer) if (stoppedat[TEAM2] > -1) { sprintf(string + strlen(string), "xv 160 yv %d string%s \"..and %d/%d more\" ", - 42 + (stoppedat[TEAM1] * 8), + 42 + (stoppedat[TEAM2] * 8), (totalalive[TEAM2] - totalaliveprinted[TEAM2]) ? "2" : "", totalalive[TEAM2] - totalaliveprinted[TEAM2], total[TEAM2] - stoppedat[TEAM2]); diff --git a/g_cmds.c b/g_cmds.c index 2627487..c9163f6 100644 --- a/g_cmds.c +++ b/g_cmds.c @@ -33,6 +33,9 @@ qboolean OnSameTeam (edict_t *ent1, edict_t *ent2) char ent2Team [512]; //FIREBLADE + if (!ent1->client || !ent2->client) + return false; + if (teamplay->value) { return ent1->client->resp.team == ent2->client->resp.team; @@ -870,23 +873,33 @@ void Cmd_Players_f (edict_t *ent) count = 0; for (i = 0 ; i < maxclients->value ; i++) + { if (game.clients[i].pers.connected) { index[count] = i; count++; } + } - // sort by frags - qsort (index, count, sizeof(index[0]), PlayerSort); + if (!teamplay->value || !noscore->value) + { + // sort by frags + qsort (index, count, sizeof(index[0]), PlayerSort); + } // print information large[0] = 0; for (i = 0 ; i < count ; i++) { - Com_sprintf (small, sizeof(small), "%3i %s\n", - game.clients[index[i]].ps.stats[STAT_FRAGS], - game.clients[index[i]].pers.netname); + if (!teamplay->value || !noscore->value) + Com_sprintf (small, sizeof(small), "%3i %s\n", + game.clients[index[i]].ps.stats[STAT_FRAGS], + game.clients[index[i]].pers.netname); + else + Com_sprintf (small, sizeof(small), "%s\n", + game.clients[index[i]].pers.netname); + if (strlen (small) + strlen(large) > sizeof(large) - 100 ) { // can't print all of them in one packet strcat (large, "...\n"); @@ -975,15 +988,15 @@ void Cmd_Say_f (edict_t *ent, qboolean team, qboolean arg0, qboolean partner_msg if (team) Com_sprintf (text, sizeof(text), "%s(%s): ", - (teamplay->value && ent->solid == SOLID_NOT) ? "[DEAD] " : "", + (teamplay->value && (ent->solid == SOLID_NOT || ent->deadflag == DEAD_DEAD)) ? "[DEAD] " : "", ent->client->pers.netname); else if (partner_msg) Com_sprintf (text, sizeof(text), "[%sPARTNER] %s: ", - (ent->solid == SOLID_NOT) ? "DEAD " : "", + (teamplay->value && (ent->solid == SOLID_NOT || ent->deadflag == DEAD_DEAD)) ? "DEAD " : "", ent->client->pers.netname); else Com_sprintf (text, sizeof(text), "%s%s: ", - (teamplay->value && ent->solid == SOLID_NOT) ? "[DEAD] " : "", + (teamplay->value && (ent->solid == SOLID_NOT || ent->deadflag == DEAD_DEAD)) ? "[DEAD] " : "", ent->client->pers.netname); if (arg0) @@ -1065,7 +1078,8 @@ void Cmd_Say_f (edict_t *ent, qboolean team, qboolean arg0, qboolean partner_msg //FIREBLADE if (teamplay->value && team_round_going) { - if (ent->solid == SOLID_NOT && other->solid != SOLID_NOT) + if ((ent->solid == SOLID_NOT || ent->deadflag == DEAD_DEAD) && + (other->solid != SOLID_NOT && other->deadflag != DEAD_DEAD)) continue; } //FIREBLADE @@ -1077,7 +1091,7 @@ void Cmd_PlayerList_f(edict_t *ent) { int i; char st[80]; - char text[1400]; + char text[1280]; edict_t *e2; // connect time, ping, score, name @@ -1086,15 +1100,24 @@ void Cmd_PlayerList_f(edict_t *ent) if (!e2->inuse) continue; - Com_sprintf(st, sizeof(st), "%02d:%02d %4d %3d %s%s\n", - (level.framenum - e2->client->resp.enterframe) / 600, - ((level.framenum - e2->client->resp.enterframe) % 600)/10, - e2->client->ping, - e2->client->resp.score, - e2->client->pers.netname, - (e2->solid == SOLID_NOT && e2->deadflag != DEAD_DEAD) ? " (spectator)" : ""); - if (strlen(text) + strlen(st) > sizeof(text) - 50) { - sprintf(text+strlen(text), "...and more.\n"); + if (!teamplay->value || !noscore->value) + Com_sprintf(st, sizeof(st), "%02d:%02d %4d %3d %s%s\n", + (level.framenum - e2->client->resp.enterframe) / 600, + ((level.framenum - e2->client->resp.enterframe) % 600)/10, + e2->client->ping, + e2->client->resp.score, + e2->client->pers.netname, + (e2->solid == SOLID_NOT && e2->deadflag != DEAD_DEAD) ? " (spectator)" : ""); + else + Com_sprintf(st, sizeof(st), "%02d:%02d %4d %s%s\n", + (level.framenum - e2->client->resp.enterframe) / 600, + ((level.framenum - e2->client->resp.enterframe) % 600)/10, + e2->client->ping, + e2->client->pers.netname, + (e2->solid == SOLID_NOT && e2->deadflag != DEAD_DEAD) ? " (spectator)" : ""); + + if (strlen(text) + strlen(st) > sizeof(text) - 100) { + sprintf(text+strlen(text), "...\n"); gi.cprintf(ent, PRINT_HIGH, "%s", text); return; } @@ -1193,7 +1216,7 @@ void ClientCommand (edict_t *ent) // else if (Q_stricmp (cmd, "laser") == 0) // SP_LaserSight (ent); else if (Q_stricmp (cmd, "reload") == 0) - Cmd_Reload_f (ent); + Cmd_New_Reload_f (ent); else if (Q_stricmp (cmd, "weapon") == 0) Cmd_Weapon_f (ent); else if (Q_stricmp (cmd, "opendoor") == 0) diff --git a/g_combat.c b/g_combat.c index b4e2d4d..c57930b 100644 --- a/g_combat.c +++ b/g_combat.c @@ -359,18 +359,18 @@ void BloodSprayThink (edict_t *self) { - if ( self->dmg > 0 ) + /* if ( self->dmg > 0 ) { self->dmg -= 10; // SpawnDamage (TE_BLOOD, self->s.origin, self->movedir, self->dmg); -/* gi.WriteByte (svc_temp_entity); + gi.WriteByte (svc_temp_entity); gi.WriteByte (TE_SPLASH); gi.WriteByte (6); gi.WritePosition (self->s.origin); gi.WriteDir (self->movedir); gi.WriteByte (6); //blood gi.multicast (self->s.origin, MULTICAST_PVS); -*/ + } else { @@ -379,6 +379,9 @@ void BloodSprayThink (edict_t *self) self->nextthink = level.time + 0.1; gi.linkentity (self); + */ + + G_FreeEdict(self); } @@ -392,12 +395,43 @@ void blood_spray_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_ -void spray_blood (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed ) +void spray_blood (edict_t *self, vec3_t start, vec3_t dir, int damage, int mod ) { edict_t *blood; + int speed; + + switch(mod) + { + case MOD_MK23: + speed = 1800; + break; + case MOD_MP5: + speed = 1500; + break; + case MOD_M4: + speed = 2400; + break; + case MOD_KNIFE: + speed = 0; + break; + case MOD_KNIFE_THROWN: + speed = 0; + break; + case MOD_DUAL: + speed = 1800; + break; + case MOD_SNIPER: + speed = 4000; + break; + default: + speed = 1800; + } + + + blood = G_Spawn(); - VectorNormalize(dir); + VectorNormalize(dir); VectorCopy (start, blood->s.origin); VectorCopy (dir, blood->movedir); vectoangles (dir, blood->s.angles); @@ -410,7 +444,7 @@ void spray_blood (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed VectorClear (blood->maxs); blood->s.modelindex = gi.modelindex ("sprites/null.sp2"); blood->owner = self; - blood->nextthink = level.time + 0.1; + blood->nextthink = level.time + speed/1000;//3.2; blood->touch = blood_spray_touch; blood->think = BloodSprayThink; blood->dmg = damage; @@ -420,8 +454,75 @@ void spray_blood (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed } +// zucc based on some code in Action Quake +void spray_sniper_blood( edict_t *self, vec3_t start, vec3_t dir ) +{ + vec3_t forward; + int mod = MOD_SNIPER; - + VectorCopy (dir, forward); + + forward[2] += .03; + + spray_blood(self, start, forward, 0, mod); + + + VectorCopy (dir, forward); + forward[2] -= .03; + spray_blood(self, start, forward, 0, mod); + + + VectorCopy (dir, forward); + if ( (forward[0] > 0) && (forward[1] > 0) ) + { + forward[0] -= .03; + forward[1] += .03; + } + if ( (forward[0] > 0) && (forward[1] < 0) ) + { + forward[0] += .03; + forward[1] += .03; + } + if ( (forward[0] < 0) && (forward[1] > 0) ) + { + forward[0] -= .03; + forward[1] -= .03; + } + if ( (forward[0] < 0) && (forward[1] < 0) ) + { + forward[0] += .03; + forward[1] -= .03; + } + spray_blood(self, start, forward, 0, mod); + + + VectorCopy (dir, forward); + if ( (forward[0] > 0) && (forward[1] > 0) ) + { + forward[0] += .03; + forward[1] -= .03; + } + if ( (forward[0] > 0) && (forward[1] < 0) ) + { + forward[0] -= .03; + forward[1] -= .03; + } + if ( (forward[0] < 0) && (forward[1] > 0) ) + { + forward[0] += .03; + forward[1] += .03; + } + if ( (forward[0] < 0) && (forward[1] < 0) ) + { + forward[0] -= .03; + forward[1] += .03; + } + spray_blood(self, start, forward, 0, mod); + + VectorCopy (dir, forward); + spray_blood(self, start, forward, 0, mod); + +} void VerifyHeadShot( vec3_t point, vec3_t dir, float height, vec3_t newpoint) @@ -487,7 +588,25 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, return; } //FIREBLADE + + // damage reduction for shotgun + // if far away, reduce it to original action levels + if ( mod == MOD_M3 ) + { + VectorSubtract(targ->s.origin, inflictor->s.origin, line ); + dist = VectorLength( line ); + if ( dist > 450.0 ) + { + damage = damage - 2; + } + + } + + + + + item = FindItem(KEV_NAME); height = abs(targ->mins[2]) + targ->maxs[2]; @@ -652,13 +771,20 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, { vec3_t temp; vec3_t temporig; - //VectorMA (targ->s.origin, 50, dir, temp); - VectorScale( dir, 20, temp); + //vec3_t forward; + VectorMA (targ->s.origin, 50, dir, temp); + //AngleVectors (attacker->client->v_angle, forward, NULL, NULL); + VectorScale( dir, 20, temp); VectorAdd( point, temp, temporig ); - spray_blood (targ, temporig, dir, damage*3, 1800 ); + if ( mod != MOD_SNIPER ) + spray_blood (targ, temporig, dir, damage, mod ); + else + { + spray_sniper_blood( targ, temporig, dir ); + } } - if ( mod == MOD_FALLING) + if ( mod == MOD_FALLING && !(targ->flags & FL_GODMODE)) { if ( targ->client && targ->health > 0) { diff --git a/g_items.c b/g_items.c index f80c09e..638e1df 100644 --- a/g_items.c +++ b/g_items.c @@ -235,40 +235,40 @@ void Drop_Special( edict_t *ent, gitem_t *item) } */ if ( stricmp( item->pickup_name, BAND_NAME ) == 0 - && ent->client->pers.inventory[ITEM_INDEX(item)] <= 1 ) + && ent->client->pers.inventory[ITEM_INDEX(item)] <= 1 ) { - ent->client->pers.max_bullets = 2; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("Pistol Clip"))] > 2 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem("Pistol Clip"))] = 2; - ent->client->pers.max_shells = 14; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("12 Gauge Shells"))] > 14 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem("12 Gauge Shells"))] = 14; - ent->client->pers.max_cells = 1; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("M4 Clip"))] > 1 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem("M4 Clip"))] = 1; - - ent->client->pers.max_grenades = 2; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem(GRENADE_NAME))] > 2 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem(GRENADE_NAME))] = 2; - - ent->client->pers.max_rockets = 2; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("Machinegun Magazine"))] > 2 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem("Machinegun Magazine"))] = 2; - - ent->client->knife_max = 10; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem(KNIFE_NAME))] > 10 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem(KNIFE_NAME))] = 10; - - ent->client->pers.max_slugs = 20; - if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("AP Sniper Ammo"))] > 20 ) - ent->client->pers.inventory[ITEM_INDEX(FindItem("AP Sniper Ammo"))] = 20; - - if ( ent->client->unique_weapon_total > unique_weapons->value && !allweapon->value ) - { - DropExtraSpecial(ent); - gi.cprintf(ent, PRINT_HIGH, "One of your guns is dropped with the bandolier.\n"); - } - } + ent->client->pers.max_bullets = 2; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("Pistol Clip"))] > 2 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem("Pistol Clip"))] = 2; + ent->client->pers.max_shells = 14; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("12 Gauge Shells"))] > 14 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem("12 Gauge Shells"))] = 14; + ent->client->pers.max_cells = 1; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("M4 Clip"))] > 1 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem("M4 Clip"))] = 1; + + ent->client->grenade_max = 2; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem(GRENADE_NAME))] > 2 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem(GRENADE_NAME))] = 2; + + ent->client->pers.max_rockets = 2; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("Machinegun Magazine"))] > 2 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem("Machinegun Magazine"))] = 2; + + ent->client->knife_max = 10; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem(KNIFE_NAME))] > 10 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem(KNIFE_NAME))] = 10; + + ent->client->pers.max_slugs = 20; + if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("AP Sniper Ammo"))] > 20 ) + ent->client->pers.inventory[ITEM_INDEX(FindItem("AP Sniper Ammo"))] = 20; + + if ( ent->client->unique_weapon_total > unique_weapons->value && !allweapon->value ) + { + DropExtraSpecial(ent); + gi.cprintf(ent, PRINT_HIGH, "One of your guns is dropped with the bandolier.\n"); + } + } Drop_Spec (ent, item); ValidateSelectedItem (ent); SP_LaserSight(ent, item); diff --git a/g_local.h b/g_local.h index 0947020..ebdaa17 100644 --- a/g_local.h +++ b/g_local.h @@ -526,6 +526,7 @@ extern cvar_t *motd_time; extern cvar_t *actionmaps; extern cvar_t *roundtimelimit; extern cvar_t *roundlimit; +extern cvar_t *skipmotd; extern cvar_t *nohud; extern cvar_t *noscore; extern cvar_t *actionversion; @@ -893,6 +894,7 @@ typedef struct //FIREBLADE qboolean spectator; + int firing_style; //FIREBLADE } client_persistant_t; @@ -1080,13 +1082,16 @@ struct gclient_s int doortoggle; // set by player with opendoor command - - edict_t* attacker; // keep track of the last person to hit us + + edict_t* attacker; // keep track of the last person to hit us int attacker_mod; // and how they hit us int attacker_loc; // location of the hit - int push_timeout; // timeout for how long an attacker will get fall death credit - + int push_timeout; // timeout for how long an attacker will get fall death credit + int jumping; + + int reload_attempts; + //FIREBLADE qboolean inmenu; // in menu @@ -1260,6 +1265,7 @@ struct edict_s void LaserSightThink (edict_t *self); void SP_LaserSight(edict_t *self, gitem_t *item ); void Cmd_Reload_f (edict_t *ent); +void Cmd_New_Reload_f (edict_t *ent); void Cmd_Weapon_f ( edict_t *ent ); void Cmd_OpenDoor_f (edict_t *ent ); void Cmd_Bandage_f ( edict_t *ent ); @@ -1366,6 +1372,8 @@ bind 6 "use Sniper Rifle" #define GRENADE_IDLE_FIRST 40 #define GRENADE_IDLE_LAST 69 +#define GRENADE_THROW_FIRST 4 +#define GRENADE_THROW_LAST 9 // throw it on frame 8? // these should be server variables, when I get around to it diff --git a/g_main.c b/g_main.c index d379608..afcf18e 100644 --- a/g_main.c +++ b/g_main.c @@ -24,6 +24,7 @@ cvar_t *motd_time; cvar_t *actionmaps; cvar_t *roundtimelimit; cvar_t *roundlimit; +cvar_t *skipmotd; cvar_t *nohud; cvar_t *noscore; cvar_t *actionversion; @@ -257,6 +258,7 @@ void EndDMLevel (void) } //FIREBLADE + ReadMOTDFile(); BeginIntermission (ent); } diff --git a/g_save.c b/g_save.c index 00620bf..42a35f1 100644 --- a/g_save.c +++ b/g_save.c @@ -1,4 +1,3 @@ - #include "g_local.h" field_t fields[] = { @@ -156,6 +155,19 @@ void InitGame (void) skill = gi.cvar ("skill", "1", CVAR_LATCH); maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH); +//FIREBLADE + if (!deathmatch->value) + { + gi.dprintf("Turning deathmatch on.\n"); + gi.cvar_set("deathmatch", "1"); + } + if (coop->value) + { + gi.dprintf("Turning coop off.\n"); + gi.cvar_set("coop", "0"); + } +//FIREBLADE + // change anytime vars dmflags = gi.cvar ("dmflags", "0", CVAR_SERVERINFO); fraglimit = gi.cvar ("fraglimit", "0", CVAR_SERVERINFO); @@ -163,18 +175,19 @@ void InitGame (void) password = gi.cvar ("password", "", CVAR_USERINFO); filterban = gi.cvar("filterban", "1", 0); //FIREBLADE - radiolog = gi.cvar("radiolog", "0", CVAR_SERVERINFO); + radiolog = gi.cvar("radiolog", "0", 0); teamplay = gi.cvar ("teamplay", "0", CVAR_SERVERINFO|CVAR_LATCH); - motd_time = gi.cvar("motd_time", "2", CVAR_SERVERINFO); + motd_time = gi.cvar("motd_time", "2", 0); hostname = gi.cvar("hostname", "unnamed", CVAR_SERVERINFO); - actionmaps = gi.cvar ("actionmaps", "1", CVAR_SERVERINFO); + actionmaps = gi.cvar ("actionmaps", "1", 0); if (actionmaps->value && num_maps < 1) { gi.dprintf("No maps were read from the config file, \"actionmaps\" won't be used.\n"); gi.cvar_set("actionmaps", "0"); } - nohud = gi.cvar("nohud", "0", CVAR_SERVERINFO|CVAR_LATCH); + nohud = gi.cvar("nohud", "0", CVAR_LATCH); roundlimit = gi.cvar("roundlimit", "0", CVAR_SERVERINFO); + skipmotd = gi.cvar("skipmotd", "0", 0); roundtimelimit = gi.cvar("roundtimelimit", "0", CVAR_SERVERINFO); noscore = gi.cvar("noscore", "0", CVAR_SERVERINFO|CVAR_LATCH); actionversion = gi.cvar("actionversion", "none set", CVAR_SERVERINFO|CVAR_LATCH); @@ -191,14 +204,14 @@ void InitGame (void) // zucc changed ir to 1, enabled ir = gi.cvar("ir", "1", CVAR_SERVERINFO); - knifelimit = gi.cvar ("knifelimit", "40", CVAR_SERVERINFO); + knifelimit = gi.cvar ("knifelimit", "40", 0); allweapon = gi.cvar ("allweapon", "0", CVAR_SERVERINFO); allitem = gi.cvar ("allitem", "0", CVAR_SERVERINFO); - tgren = gi.cvar ("tgren", "0", CVAR_SERVERINFO); - // zucc from action - sv_shelloff = gi.cvar ("shelloff", "1", CVAR_SERVERINFO); - bholelimit = gi.cvar ("bholelimit", "0", CVAR_SERVERINFO); - splatlimit = gi.cvar ("splatlimit", "0", CVAR_SERVERINFO); + tgren = gi.cvar ("tgren", "0", CVAR_SERVERINFO); + // zucc from action + sv_shelloff = gi.cvar ("shelloff", "1", 0); + bholelimit = gi.cvar ("bholelimit", "0", 0); + splatlimit = gi.cvar ("splatlimit", "0", 0); g_select_empty = gi.cvar ("g_select_empty", "0", CVAR_ARCHIVE); diff --git a/g_spawn.c b/g_spawn.c index d176bc2..cb56b93 100644 --- a/g_spawn.c +++ b/g_spawn.c @@ -315,7 +315,7 @@ void ED_CallSpawn (edict_t *ent) //item[i][0] = the Q2 item to look for //item[i][1] = the NS2 item to actually spawn -#define ITEM_SWITCH_COUNT 12 +#define ITEM_SWITCH_COUNT 15 char *sp_item[ITEM_SWITCH_COUNT][2]= { @@ -333,6 +333,10 @@ char *sp_item[ITEM_SWITCH_COUNT][2]= {"ammo_slugs", "ammo_sniper"}, {"ammo_shells", "ammo_m3"}, {"ammo_grenades", "weapon_Grenade"} + , + {"ammo_box", "ammo_m3"}, + {"weapon_cannon", "weapon_HC"}, + {"weapon_sniper", "weapon_Sniper"} }; @@ -346,7 +350,7 @@ void CheckItem(edict_t *ent, gitem_t *item) if(!sp_item[i][0]) continue; //Do the passed ent and our list match? - if(Q_stricmp(ent->classname,sp_item[i][0])==0) + if(strcmp(ent->classname,sp_item[i][0])==0) { //Yep. Replace the Q2 entity with our own. ent->classname = item->classname = sp_item[i][1]; diff --git a/g_svcmds.c b/g_svcmds.c index f609fba..3996e77 100644 --- a/g_svcmds.c +++ b/g_svcmds.c @@ -1,10 +1,9 @@ - #include "g_local.h" - -void Svcmd_Test_f (void) +void SVCmd_ReloadMOTD_f() { - gi.cprintf (NULL, PRINT_HIGH, "Svcmd_Test_f()\n"); + ReadMOTDFile(); + gi.cprintf(NULL, PRINT_HIGH, "MOTD reloaded.\n"); } /* @@ -265,9 +264,8 @@ void ServerCommand (void) char *cmd; cmd = gi.argv(1); - if (Q_stricmp (cmd, "test") == 0) - Svcmd_Test_f (); - else if (Q_stricmp (cmd, "addip") == 0) + + if (Q_stricmp (cmd, "addip") == 0) SVCmd_AddIP_f (); else if (Q_stricmp (cmd, "removeip") == 0) SVCmd_RemoveIP_f (); @@ -275,6 +273,8 @@ void ServerCommand (void) SVCmd_ListIP_f (); else if (Q_stricmp (cmd, "writeip") == 0) SVCmd_WriteIP_f (); + else if (Q_stricmp (cmd, "reloadmotd") == 0) + SVCmd_ReloadMOTD_f(); else gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd); } diff --git a/g_weapon.c b/g_weapon.c index 452ffe3..ebeb6e6 100644 --- a/g_weapon.c +++ b/g_weapon.c @@ -1410,6 +1410,7 @@ void knife_throw (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed { edict_t *knife; // vec3_t forward, right, up; + trace_t tr; knife = G_Spawn(); @@ -1452,6 +1453,14 @@ void knife_throw (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed // if (self->client) // check_dodge (self, rocket->s.origin, dir, speed); + tr = gi.trace (self->s.origin, NULL, NULL, knife->s.origin, knife, MASK_SHOT); + if (tr.fraction < 1.0) + { + VectorMA (knife->s.origin, -10, dir, knife->s.origin); + knife->touch (knife, tr.ent, NULL, NULL); + } + + gi.linkentity (knife); } diff --git a/p_client.c b/p_client.c index 30b23db..9d74f41 100644 --- a/p_client.c +++ b/p_client.c @@ -8,49 +8,49 @@ void CopyToBodyQue (edict_t *ent); void Add_Frag( edict_t *ent ) { - ent->client->resp.kills++; - ent->client->resp.streak++; - if ( teamplay->value || (ent->client->resp.streak < 4) ) - { - ent->client->resp.score++; // just 1 normal kill - } - else if ( ent->client->resp.streak < 8 ) - { - gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", - ent->client->pers.netname, ent->client->resp.streak, 2); - ent->client->resp.score += 2; - } - else if ( ent->client->resp.streak < 16 ) - { - gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", - ent->client->pers.netname, ent->client->resp.streak, 4); - ent->client->resp.score += 4; - } - else if ( ent->client->resp.streak < 32 ) - { - gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", - ent->client->pers.netname, ent->client->resp.streak, 8); - ent->client->resp.score += 8; - } - else - { - gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", - ent->client->pers.netname, ent->client->resp.streak, 16); - ent->client->resp.score += 16; - } + ent->client->resp.kills++; + ent->client->resp.streak++; + if ( teamplay->value || (ent->client->resp.streak < 4) ) + { + ent->client->resp.score++; // just 1 normal kill + } + else if ( ent->client->resp.streak < 8 ) + { + gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", + ent->client->pers.netname, ent->client->resp.streak, 2); + ent->client->resp.score += 2; + } + else if ( ent->client->resp.streak < 16 ) + { + gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", + ent->client->pers.netname, ent->client->resp.streak, 4); + ent->client->resp.score += 4; + } + else if ( ent->client->resp.streak < 32 ) + { + gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", + ent->client->pers.netname, ent->client->resp.streak, 8); + ent->client->resp.score += 8; + } + else + { + gi.bprintf (PRINT_MEDIUM,"%s has %d kills in a row and receives %d frags for the kill!\n", + ent->client->pers.netname, ent->client->resp.streak, 16); + ent->client->resp.score += 16; + } //FIREBLADE - if (!teamplay->value && ent->client->resp.streak >= 1) + if (!teamplay->value && ent->client->resp.streak >= 1) //FIREBLADE - { - gi.cprintf(ent, PRINT_HIGH, "Kill count: %d\n", ent->client->resp.streak ); - } + { + gi.cprintf(ent, PRINT_HIGH, "Kill count: %d\n", ent->client->resp.streak ); + } } void Subtract_Frag( edict_t *ent ) { - ent->client->resp.score--; - ent->client->resp.streak = 0; + ent->client->resp.score--; + ent->client->resp.streak = 0; } @@ -69,29 +69,29 @@ void Subtract_Frag( edict_t *ent ) static void SP_FixCoopSpots (edict_t *self) { - edict_t *spot; - vec3_t d; + edict_t *spot; + vec3_t d; - spot = NULL; + spot = NULL; - while(1) - { - spot = G_Find(spot, FOFS(classname), "info_player_start"); - if (!spot) - return; - if (!spot->targetname) - continue; - VectorSubtract(self->s.origin, spot->s.origin, d); - if (VectorLength(d) < 384) - { - if ((!self->targetname) || stricmp(self->targetname, spot->targetname) != 0) - { + while(1) + { + spot = G_Find(spot, FOFS(classname), "info_player_start"); + if (!spot) + return; + if (!spot->targetname) + continue; + VectorSubtract(self->s.origin, spot->s.origin, d); + if (VectorLength(d) < 384) + { + if ((!self->targetname) || stricmp(self->targetname, spot->targetname) != 0) + { // gi.dprintf("FixCoopSpots changed %s at %s targetname from %s to %s\n", self->classname, vtos(self->s.origin), self->targetname, spot->targetname); - self->targetname = spot->targetname; - } - return; - } - } + self->targetname = spot->targetname; + } + return; + } + } } // now if that one wasn't ugly enough for you then try this one on for size @@ -100,36 +100,36 @@ static void SP_FixCoopSpots (edict_t *self) static void SP_CreateCoopSpots (edict_t *self) { - edict_t *spot; + edict_t *spot; - if(stricmp(level.mapname, "security") == 0) - { - spot = G_Spawn(); - spot->classname = "info_player_coop"; - spot->s.origin[0] = 188 - 64; - spot->s.origin[1] = -164; - spot->s.origin[2] = 80; - spot->targetname = "jail3"; - spot->s.angles[1] = 90; + if(stricmp(level.mapname, "security") == 0) + { + spot = G_Spawn(); + spot->classname = "info_player_coop"; + spot->s.origin[0] = 188 - 64; + spot->s.origin[1] = -164; + spot->s.origin[2] = 80; + spot->targetname = "jail3"; + spot->s.angles[1] = 90; - spot = G_Spawn(); - spot->classname = "info_player_coop"; - spot->s.origin[0] = 188 + 64; - spot->s.origin[1] = -164; - spot->s.origin[2] = 80; - spot->targetname = "jail3"; - spot->s.angles[1] = 90; + spot = G_Spawn(); + spot->classname = "info_player_coop"; + spot->s.origin[0] = 188 + 64; + spot->s.origin[1] = -164; + spot->s.origin[2] = 80; + spot->targetname = "jail3"; + spot->s.angles[1] = 90; - spot = G_Spawn(); - spot->classname = "info_player_coop"; - spot->s.origin[0] = 188 + 128; - spot->s.origin[1] = -164; - spot->s.origin[2] = 80; - spot->targetname = "jail3"; - spot->s.angles[1] = 90; + spot = G_Spawn(); + spot->classname = "info_player_coop"; + spot->s.origin[0] = 188 + 128; + spot->s.origin[1] = -164; + spot->s.origin[2] = 80; + spot->targetname = "jail3"; + spot->s.angles[1] = 90; - return; - } + return; + } } @@ -138,14 +138,14 @@ The normal starting point for a level. */ void SP_info_player_start(edict_t *self) { - if (!coop->value) - return; - if(stricmp(level.mapname, "security") == 0) - { - // invoke one of our gross, ugly, disgusting hacks - self->think = SP_CreateCoopSpots; - self->nextthink = level.time + FRAMETIME; - } + if (!coop->value) + return; + if(stricmp(level.mapname, "security") == 0) + { + // invoke one of our gross, ugly, disgusting hacks + self->think = SP_CreateCoopSpots; + self->nextthink = level.time + FRAMETIME; + } } /*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 32) @@ -153,12 +153,12 @@ potential spawning position for deathmatch games */ void SP_info_player_deathmatch(edict_t *self) { - if (!deathmatch->value) - { - G_FreeEdict (self); - return; - } - SP_misc_teleporter_dest (self); + if (!deathmatch->value) + { + G_FreeEdict (self); + return; + } + SP_misc_teleporter_dest (self); } /*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 32) @@ -167,31 +167,31 @@ potential spawning position for coop games void SP_info_player_coop(edict_t *self) { - if (!coop->value) - { - G_FreeEdict (self); - return; - } + if (!coop->value) + { + G_FreeEdict (self); + return; + } - if((stricmp(level.mapname, "jail2") == 0) || - (stricmp(level.mapname, "jail4") == 0) || - (stricmp(level.mapname, "mine1") == 0) || - (stricmp(level.mapname, "mine2") == 0) || - (stricmp(level.mapname, "mine3") == 0) || - (stricmp(level.mapname, "mine4") == 0) || - (stricmp(level.mapname, "lab") == 0) || - (stricmp(level.mapname, "boss1") == 0) || - (stricmp(level.mapname, "fact3") == 0) || - (stricmp(level.mapname, "biggun") == 0) || - (stricmp(level.mapname, "space") == 0) || - (stricmp(level.mapname, "command") == 0) || - (stricmp(level.mapname, "power2") == 0) || - (stricmp(level.mapname, "strike") == 0)) - { - // invoke one of our gross, ugly, disgusting hacks - self->think = SP_FixCoopSpots; - self->nextthink = level.time + FRAMETIME; - } + if((stricmp(level.mapname, "jail2") == 0) || + (stricmp(level.mapname, "jail4") == 0) || + (stricmp(level.mapname, "mine1") == 0) || + (stricmp(level.mapname, "mine2") == 0) || + (stricmp(level.mapname, "mine3") == 0) || + (stricmp(level.mapname, "mine4") == 0) || + (stricmp(level.mapname, "lab") == 0) || + (stricmp(level.mapname, "boss1") == 0) || + (stricmp(level.mapname, "fact3") == 0) || + (stricmp(level.mapname, "biggun") == 0) || + (stricmp(level.mapname, "space") == 0) || + (stricmp(level.mapname, "command") == 0) || + (stricmp(level.mapname, "power2") == 0) || + (stricmp(level.mapname, "strike") == 0)) + { + // invoke one of our gross, ugly, disgusting hacks + self->think = SP_FixCoopSpots; + self->nextthink = level.time + FRAMETIME; + } } @@ -209,36 +209,36 @@ void SP_info_player_intermission(void) void player_pain (edict_t *self, edict_t *other, float kick, int damage) { - // player pain is handled at the end of the frame in P_DamageFeedback + // player pain is handled at the end of the frame in P_DamageFeedback } qboolean IsFemale (edict_t *ent) { - char *info; + char *info; - if (!ent->client) - return false; + if (!ent->client) + return false; - // "gender" below used to be "skin", 3.20 change -FB - info = Info_ValueForKey (ent->client->pers.userinfo, "gender"); - if (info[0] == 'f' || info[0] == 'F') - return true; - return false; + // "gender" below used to be "skin", 3.20 change -FB + info = Info_ValueForKey (ent->client->pers.userinfo, "gender"); + if (info[0] == 'f' || info[0] == 'F') + return true; + return false; } // FROM 3.20 -FB qboolean IsNeutral (edict_t *ent) { - char *info; - - if (!ent->client) - return false; - - info = Info_ValueForKey (ent->client->pers.userinfo, "gender"); - if (info[0] != 'f' && info[0] != 'F' && info[0] != 'm' && info[0] != 'M') - return true; - return false; + char *info; + + if (!ent->client) + return false; + + info = Info_ValueForKey (ent->client->pers.userinfo, "gender"); + if (info[0] != 'f' && info[0] != 'F' && info[0] != 'm' && info[0] != 'M') + return true; + return false; } // ^^^ @@ -246,27 +246,27 @@ qboolean IsNeutral (edict_t *ent) // the fact that live players shouldn't receive them in teamplay. -FB void PrintDeathMessage(char *msg, edict_t *gibee) { - int j; - edict_t *other; - - if (!teamplay->value) - { - gi.bprintf(PRINT_MEDIUM, msg); - return; - } - - if (dedicated->value) - gi.cprintf(NULL, PRINT_MEDIUM, "%s", msg); - - for (j = 1; j <= game.maxclients; j++) - { - other = &g_edicts[j]; - if (!other->inuse || !other->client) - continue; - if (gibee != other && team_round_going && other->solid != SOLID_NOT) - continue; - gi.cprintf(other, PRINT_MEDIUM, "%s", msg); - } + int j; + edict_t *other; + + if (!teamplay->value) + { + gi.bprintf(PRINT_MEDIUM, msg); + return; + } + + if (dedicated->value) + gi.cprintf(NULL, PRINT_MEDIUM, "%s", msg); + + for (j = 1; j <= game.maxclients; j++) + { + other = &g_edicts[j]; + if (!other->inuse || !other->client) + continue; + if (gibee != other && team_round_going && other->solid != SOLID_NOT) + continue; + gi.cprintf(other, PRINT_MEDIUM, "%s", msg); + } } void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) @@ -512,21 +512,21 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) message2 = "'s M4 Assault Rifle"; } break; - case MOD_M3: + case MOD_M3: n = rand() % 2 + 1; if (n == 1) {message = " accepts"; message2 = "'s M3 Super 90 Assault Shotgun in hole-y matrimony";} if (n == 2) {message = " is full of buckshot from"; message2 = "'s M3 Super 90 Assault Shotgun";} break; - case MOD_HC: + case MOD_HC: n = rand() % 2 + 1; if (n == 1) {message = " ate"; message2 = "'s sawed-off 12 gauge";} if (n == 2) {message = " is full of buckshot from"; message2 = "'s sawed off shotgun";} break; - case MOD_SNIPER: + case MOD_SNIPER: switch (loc) { case LOC_HDAM: @@ -557,10 +557,10 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) } break; case MOD_DUAL: - switch (loc) - { + switch (loc) + { case LOC_HDAM: - message = " was trepaned by"; + message = " was trepanned by"; message2 = "'s akimbo Mark 23 pistols"; break; case LOC_CDAM: @@ -578,11 +578,11 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) - default: + default: message = " was shot by"; message2 = "'s pair of Mark 23 Pistols"; - } - break; + } + break; case MOD_KNIFE: switch (loc) { @@ -595,21 +595,21 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) message = " had her throat slit by"; else message = " had his throat slit by"; - break; + break; case LOC_CDAM: - message = " had open heart surgery, compliments of"; - break; + message = " had open heart surgery, compliments of"; + break; case LOC_SDAM: - message = " was gutted by"; - break; + message = " was gutted by"; + break; case LOC_LDAM: - message = " was stabbed repeatedly in the legs by"; - break; + message = " was stabbed repeatedly in the legs by"; + break; default: - message = " was slashed apart by"; - message2 = "'s Combat Knife"; + message = " was slashed apart by"; + message2 = "'s Combat Knife"; } - gi.sound(self, CHAN_VOICE, gi.soundindex("misc/glurp.wav"), 1, ATTN_NORM, 0); + break; case MOD_KNIFE_THROWN: switch (loc) @@ -623,11 +623,11 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) else message2 = "'s flying knife with his forehead"; break; - case LOC_CDAM: + case LOC_CDAM: message = "'s ribs don't help against"; message2 = "'s flying knife"; break; - case LOC_SDAM: + case LOC_SDAM: if (IsNeutral(self)) message = " sees the contents of its own stomach thanks to"; else if (IsFemale(self)) @@ -636,36 +636,23 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) message = " sees the contents of his own stomach thanks to"; message2 = "'s flying knife"; break; - case LOC_LDAM: + case LOC_LDAM: if (IsNeutral(self)) message = " had its legs cut off thanks to"; else if (IsFemale(self)) message = " had her legs cut off thanks to"; else - message = " had his legs cut off thanks to"; - - - - - - - - - - - - - + message = " had his legs cut off thanks to"; message2 = "'s flying knife"; break; - default: + default: message = " was hit by"; message2 = "'s flying Combat Knife"; } - gi.sound(self, CHAN_VOICE, gi.soundindex("misc/glurp.wav"), 1, ATTN_NORM, 0); + break; case MOD_GAS: message = "sucks down some toxic gas thanks to"; @@ -784,9 +771,9 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) message = " tried to invade"; message2 = "'s personal space"; break; - } - if (message) - { + } + if (message) + { //FIREBLADE sprintf(death_msg, "%s%s %s%s\n", self->client->pers.netname, message, attacker->client->pers.netname, message2); PrintDeathMessage(death_msg, self); @@ -804,15 +791,15 @@ void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker) } } return; - } - } - } + } + } + } //FIREBLADE - sprintf(death_msg, "%s died\n", self->client->pers.netname); - PrintDeathMessage(death_msg, self); + sprintf(death_msg, "%s died\n", self->client->pers.netname); + PrintDeathMessage(death_msg, self); //FIREBLADE - if (deathmatch->value) + if (deathmatch->value) Subtract_Frag( self );//self->client->resp.score--; } @@ -821,18 +808,18 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf // zucc used to toss an item on death void EjectItem( edict_t *ent, gitem_t *item ) { - edict_t *drop; - float spread; - if (item) - { - spread = 300.0*crandom(); - ent->client->v_angle[YAW] -= spread; - drop = Drop_Item (ent, item); - ent->client->v_angle[YAW] += spread; - drop->spawnflags = DROPPED_PLAYER_ITEM; - } - - + edict_t *drop; + float spread; + if (item) + { + spread = 300.0*crandom(); + ent->client->v_angle[YAW] -= spread; + drop = Drop_Item (ent, item); + ent->client->v_angle[YAW] += spread; + drop->spawnflags = DROPPED_PLAYER_ITEM; + } + + } @@ -840,17 +827,17 @@ void EjectItem( edict_t *ent, gitem_t *item ) // unique weapons need to be specially treated so they respawn properly void EjectWeapon( edict_t *ent, gitem_t *item ) { - edict_t *drop; - float spread; - if (item) - { - spread = 300.0*crandom(); - ent->client->v_angle[YAW] -= spread; - drop = Drop_Item (ent, item); - ent->client->v_angle[YAW] += spread; - drop->spawnflags = DROPPED_PLAYER_ITEM; - drop->think = temp_think_specweap; - } + edict_t *drop; + float spread; + if (item) + { + spread = 300.0*crandom(); + ent->client->v_angle[YAW] -= spread; + drop = Drop_Item (ent, item); + ent->client->v_angle[YAW] += spread; + drop->spawnflags = DROPPED_PLAYER_ITEM; + drop->think = temp_think_specweap; + } } @@ -860,143 +847,143 @@ void EjectWeapon( edict_t *ent, gitem_t *item ) //zucc toss items on death void TossItemsOnDeath( edict_t *ent ) { - gitem_t *item; - - - // don't bother dropping stuff when allweapons/items is active - if (allitem->value && allweapon->value) - { - // remove the lasersight because then the observer might have it - item = FindItem(LASER_NAME); - ent->client->pers.inventory[ITEM_INDEX(item)] = 0; - return; - } - - - // don't drop weapons if allweapons is on - if (allweapon->value) - { - DeadDropSpec(ent); - return; - } - - // only drop items if allitems is not on - if(!allitem->value) - DeadDropSpec(ent); - else - { // remove the lasersight because then the observer might have it - item = FindItem(LASER_NAME); - ent->client->pers.inventory[ITEM_INDEX(item)] = 0; - SP_LaserSight(ent, item); - } - // give the player a dual pistol so they can be sure to drop one - item = FindItem(DUAL_NAME); - ent->client->pers.inventory[ITEM_INDEX(item)]++; - EjectItem( ent, item ); - - // check for every item we want to drop when a player dies - item = FindItem(MP5_NAME); - while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) - { - ent->client->pers.inventory[ITEM_INDEX(item)]--; - EjectWeapon( ent, item ); - } - item = FindItem(M4_NAME); - while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) - { - ent->client->pers.inventory[ITEM_INDEX(item)]--; - EjectWeapon( ent, item ); - } - item = FindItem(M3_NAME); - while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) - { - ent->client->pers.inventory[ITEM_INDEX(item)]--; - EjectWeapon( ent, item ); - } - item = FindItem(HC_NAME); - while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) - { - ent->client->pers.inventory[ITEM_INDEX(item)]--; - EjectWeapon( ent, item ); - } - item = FindItem(SNIPER_NAME); - while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) - { - ent->client->pers.inventory[ITEM_INDEX(item)]--; - EjectWeapon( ent, item ); - } - item = FindItem(KNIFE_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) - { - EjectItem( ent, item ); - } + gitem_t *item; + + + // don't bother dropping stuff when allweapons/items is active + if (allitem->value && allweapon->value) + { + // remove the lasersight because then the observer might have it + item = FindItem(LASER_NAME); + ent->client->pers.inventory[ITEM_INDEX(item)] = 0; + return; + } + + + // don't drop weapons if allweapons is on + if (allweapon->value) + { + DeadDropSpec(ent); + return; + } + + // only drop items if allitems is not on + if(!allitem->value) + DeadDropSpec(ent); + else + { // remove the lasersight because then the observer might have it + item = FindItem(LASER_NAME); + ent->client->pers.inventory[ITEM_INDEX(item)] = 0; + SP_LaserSight(ent, item); + } + // give the player a dual pistol so they can be sure to drop one + item = FindItem(DUAL_NAME); + ent->client->pers.inventory[ITEM_INDEX(item)]++; + EjectItem( ent, item ); + + // check for every item we want to drop when a player dies + item = FindItem(MP5_NAME); + while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) + { + ent->client->pers.inventory[ITEM_INDEX(item)]--; + EjectWeapon( ent, item ); + } + item = FindItem(M4_NAME); + while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) + { + ent->client->pers.inventory[ITEM_INDEX(item)]--; + EjectWeapon( ent, item ); + } + item = FindItem(M3_NAME); + while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) + { + ent->client->pers.inventory[ITEM_INDEX(item)]--; + EjectWeapon( ent, item ); + } + item = FindItem(HC_NAME); + while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) + { + ent->client->pers.inventory[ITEM_INDEX(item)]--; + EjectWeapon( ent, item ); + } + item = FindItem(SNIPER_NAME); + while ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) + { + ent->client->pers.inventory[ITEM_INDEX(item)]--; + EjectWeapon( ent, item ); + } + item = FindItem(KNIFE_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] > 0 ) + { + EjectItem( ent, item ); + } // special items /* - item = FindItem(SIL_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) - EjectItem( ent, item ); - item = FindItem(SLIP_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) - EjectItem( ent, item ); - item = FindItem(BAND_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) - EjectItem( ent, item ); - item = FindItem(KEV_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) - EjectItem( ent, item ); - item = FindItem(LASER_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) - EjectItem( ent, item ); + item = FindItem(SIL_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) + EjectItem( ent, item ); + item = FindItem(SLIP_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) + EjectItem( ent, item ); + item = FindItem(BAND_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) + EjectItem( ent, item ); + item = FindItem(KEV_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) + EjectItem( ent, item ); + item = FindItem(LASER_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] ) + EjectItem( ent, item ); */ } void TossClientWeapon (edict_t *self) { - gitem_t *item; - edict_t *drop; - qboolean quad; - float spread; + gitem_t *item; + edict_t *drop; + qboolean quad; + float spread; - if (!deathmatch->value) - return; + if (!deathmatch->value) + return; - item = self->client->pers.weapon; - if (! self->client->pers.inventory[self->client->ammo_index] ) - item = NULL; - if (item && (strcmp (item->pickup_name, "Blaster") == 0)) - item = NULL; + item = self->client->pers.weapon; + if (! self->client->pers.inventory[self->client->ammo_index] ) + item = NULL; + if (item && (strcmp (item->pickup_name, "Blaster") == 0)) + item = NULL; - if (!((int)(dmflags->value) & DF_QUAD_DROP)) - quad = false; - else - quad = (self->client->quad_framenum > (level.framenum + 10)); + if (!((int)(dmflags->value) & DF_QUAD_DROP)) + quad = false; + else + quad = (self->client->quad_framenum > (level.framenum + 10)); - if (item && quad) - spread = 22.5; - else - spread = 0.0; + if (item && quad) + spread = 22.5; + else + spread = 0.0; - if (item) - { - self->client->v_angle[YAW] -= spread; - drop = Drop_Item (self, item); - self->client->v_angle[YAW] += spread; - drop->spawnflags = DROPPED_PLAYER_ITEM; - } + if (item) + { + self->client->v_angle[YAW] -= spread; + drop = Drop_Item (self, item); + self->client->v_angle[YAW] += spread; + drop->spawnflags = DROPPED_PLAYER_ITEM; + } - if (quad) - { - self->client->v_angle[YAW] += spread; - drop = Drop_Item (self, FindItemByClassname ("item_quad")); - self->client->v_angle[YAW] -= spread; - drop->spawnflags |= DROPPED_PLAYER_ITEM; + if (quad) + { + self->client->v_angle[YAW] += spread; + drop = Drop_Item (self, FindItemByClassname ("item_quad")); + self->client->v_angle[YAW] -= spread; + drop->spawnflags |= DROPPED_PLAYER_ITEM; - drop->touch = Touch_Item; - drop->nextthink = level.time + (self->client->quad_framenum - level.framenum) * FRAMETIME; - drop->think = G_FreeEdict; - } + drop->touch = Touch_Item; + drop->nextthink = level.time + (self->client->quad_framenum - level.framenum) * FRAMETIME; + drop->think = G_FreeEdict; + } } @@ -1007,34 +994,34 @@ LookAtKiller */ void LookAtKiller (edict_t *self, edict_t *inflictor, edict_t *attacker) { - vec3_t dir; + vec3_t dir; - if (attacker && attacker != world && attacker != self) - { - VectorSubtract (attacker->s.origin, self->s.origin, dir); - } - else if (inflictor && inflictor != world && inflictor != self) - { - VectorSubtract (inflictor->s.origin, self->s.origin, dir); - } - else - { - self->client->killer_yaw = self->s.angles[YAW]; - return; - } + if (attacker && attacker != world && attacker != self) + { + VectorSubtract (attacker->s.origin, self->s.origin, dir); + } + else if (inflictor && inflictor != world && inflictor != self) + { + VectorSubtract (inflictor->s.origin, self->s.origin, dir); + } + else + { + self->client->killer_yaw = self->s.angles[YAW]; + return; + } // NEW FORMULA FOR THIS FROM 3.20 -FB - if (dir[0]) - self->client->killer_yaw = 180/M_PI*atan2(dir[1], dir[0]); - else { - self->client->killer_yaw = 0; - if (dir[1] > 0) - self->client->killer_yaw = 90; - else if (dir[1] < 0) - self->client->killer_yaw = -90; - } - if (self->client->killer_yaw < 0) - self->client->killer_yaw += 360; + if (dir[0]) + self->client->killer_yaw = 180/M_PI*atan2(dir[1], dir[0]); + else { + self->client->killer_yaw = 0; + if (dir[1] > 0) + self->client->killer_yaw = 90; + else if (dir[1] < 0) + self->client->killer_yaw = -90; + } + if (self->client->killer_yaw < 0) + self->client->killer_yaw += 360; // ^^^ } @@ -1047,137 +1034,144 @@ void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag { // int n; - VectorClear (self->avelocity); - - self->takedamage = DAMAGE_YES; - self->movetype = MOVETYPE_TOSS; - + VectorClear (self->avelocity); + + self->takedamage = DAMAGE_YES; + self->movetype = MOVETYPE_TOSS; + //FIREBLADE - if (self->solid == SOLID_TRIGGER) - { - self->solid = SOLID_BBOX; - gi.linkentity(self); - RemoveFromTransparentList(self); - } + if (self->solid == SOLID_TRIGGER) + { + self->solid = SOLID_BBOX; + gi.linkentity(self); + RemoveFromTransparentList(self); + } //FIREBLADE - // zucc solves problem of people stopping doors while in their dead bodies - // - // ...only need it in DM though... - // ...for teamplay, non-solid will get set soon after in CopyToBodyQue - if (!teamplay->value) - { - self->solid = SOLID_NOT; - gi.linkentity(self); - } + // zucc solves problem of people stopping doors while in their dead bodies + // + // ...only need it in DM though... + // ...for teamplay, non-solid will get set soon after in CopyToBodyQue + if (!teamplay->value) + { + self->solid = SOLID_NOT; + gi.linkentity(self); + } - self->s.modelindex2 = 0; // remove linked weapon model + self->s.modelindex2 = 0; // remove linked weapon model - self->s.angles[0] = 0; - self->s.angles[2] = 0; + self->s.angles[0] = 0; + self->s.angles[2] = 0; - self->s.sound = 0; - self->client->weapon_sound = 0; + self->s.sound = 0; + self->client->weapon_sound = 0; - self->maxs[2] = -8; + self->maxs[2] = -8; - self->svflags |= SVF_DEADMONSTER; + self->svflags |= SVF_DEADMONSTER; - if (!self->deadflag) - { - self->client->respawn_time = level.time + 1.0; - LookAtKiller (self, inflictor, attacker); - self->client->ps.pmove.pm_type = PM_DEAD; - ClientObituary (self, inflictor, attacker); - //TossClientWeapon (self); - TossItemsOnDeath(self); + if (!self->deadflag) + { + self->client->respawn_time = level.time + 1.0; + LookAtKiller (self, inflictor, attacker); + self->client->ps.pmove.pm_type = PM_DEAD; + ClientObituary (self, inflictor, attacker); + //TossClientWeapon (self); + TossItemsOnDeath(self); //FIREBLADE - if (deathmatch->value && !teamplay->value) + if (deathmatch->value && !teamplay->value) //FIREBLADE - Cmd_Help_f (self); // show scores - } + Cmd_Help_f (self); // show scores + } - // remove powerups - self->client->quad_framenum = 0; - self->client->invincible_framenum = 0; - self->client->breather_framenum = 0; - self->client->enviro_framenum = 0; + // remove powerups + self->client->quad_framenum = 0; + self->client->invincible_framenum = 0; + self->client->breather_framenum = 0; + self->client->enviro_framenum = 0; - //zucc remove lasersight - if (self->lasersight) - SP_LaserSight(self, NULL); + //zucc remove lasersight + if (self->lasersight) + SP_LaserSight(self, NULL); //FIREBLADE - // clean up sniper rifle stuff - self->client->no_sniper_display = 0; - self->client->resp.sniper_mode = SNIPER_1X; - self->client->desired_fov = 90; - self->client->ps.fov = 90; + // clean up sniper rifle stuff + self->client->no_sniper_display = 0; + self->client->resp.sniper_mode = SNIPER_1X; + self->client->desired_fov = 90; + self->client->ps.fov = 90; //FIREBLADE - - self->client->resp.streak = 0; - Bandage(self); // clear up the leg damage when dead sound? - self->client->bandage_stopped = 0; + + self->client->resp.streak = 0; + Bandage(self); // clear up the leg damage when dead sound? + self->client->bandage_stopped = 0; - // clear inventory - memset(self->client->pers.inventory, 0, sizeof(self->client->pers.inventory)); + // clear inventory + memset(self->client->pers.inventory, 0, sizeof(self->client->pers.inventory)); - // zucc - check if they have a primed grenade - if ( self->client->curr_weap == GRENADE_NUM - && ( self->client->ps.gunframe >= GRENADE_IDLE_FIRST - && self->client->ps.gunframe <= GRENADE_IDLE_LAST ) ) - { - self->client->ps.gunframe = 0; - fire_grenade2 (self, self->s.origin, tv(0,0,0), GRENADE_DAMRAD, 0, 2, GRENADE_DAMRAD*2, false); - } + // zucc - check if they have a primed grenade + if ( self->client->curr_weap == GRENADE_NUM && + ( + ( self->client->ps.gunframe >= GRENADE_IDLE_FIRST + && self->client->ps.gunframe <= GRENADE_IDLE_LAST ) + || ( self->client->ps.gunframe >= GRENADE_THROW_FIRST + && self->client->ps.gunframe <= GRENADE_THROW_LAST ) + ) ) + { + self->client->ps.gunframe = 0; + fire_grenade2 (self, self->s.origin, tv(0,0,0), GRENADE_DAMRAD, 0, 2, GRENADE_DAMRAD*2, false); + } - //zucc no gibbing + //zucc no gibbing /* if (self->health < -40) - { // gib - gi.sound (self, CHAN_BODY, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); - for (n= 0; n < 4; n++) - ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); - ThrowClientHead (self, damage); + { // gib + gi.sound (self, CHAN_BODY, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); + for (n= 0; n < 4; n++) + ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); + ThrowClientHead (self, damage); - self->takedamage = DAMAGE_NO; - }*/ + self->takedamage = DAMAGE_NO; + }*/ // else - { // normal death - if (!self->deadflag) - { - static int i; + { // normal death + if (!self->deadflag) + { + static int i; - i = (i+1)%3; - // start a death animation - self->client->anim_priority = ANIM_DEATH; - if (self->client->ps.pmove.pm_flags & PMF_DUCKED) - { - self->s.frame = FRAME_crdeath1-1; - self->client->anim_end = FRAME_crdeath5; - } - else switch (i) - { - case 0: - self->s.frame = FRAME_death101-1; - self->client->anim_end = FRAME_death106; - break; - case 1: - self->s.frame = FRAME_death201-1; - self->client->anim_end = FRAME_death206; - break; - case 2: - self->s.frame = FRAME_death301-1; - self->client->anim_end = FRAME_death308; - break; - } - gi.sound (self, CHAN_VOICE, gi.soundindex(va("*death%i.wav", (rand()%4)+1)), 1, ATTN_NORM, 0); - } - } - // zucc this will fix a jump kick death generating a weapon - self->client->curr_weap = MK23_NUM; - self->deadflag = DEAD_DEAD; + i = (i+1)%3; + // start a death animation + self->client->anim_priority = ANIM_DEATH; + if (self->client->ps.pmove.pm_flags & PMF_DUCKED) + { + self->s.frame = FRAME_crdeath1-1; + self->client->anim_end = FRAME_crdeath5; + } + else switch (i) + { + case 0: + self->s.frame = FRAME_death101-1; + self->client->anim_end = FRAME_death106; + break; + case 1: + self->s.frame = FRAME_death201-1; + self->client->anim_end = FRAME_death206; + break; + case 2: + self->s.frame = FRAME_death301-1; + self->client->anim_end = FRAME_death308; + break; + } + if ((meansOfDeath == MOD_SNIPER) || (meansOfDeath == MOD_KNIFE) || (meansOfDeath == MOD_KNIFE_THROWN)) + gi.sound(self, CHAN_VOICE, gi.soundindex("misc/glurp.wav"), 1, ATTN_NORM, 0); + else + gi.sound (self, CHAN_VOICE, gi.soundindex(va("*death%i.wav", (rand()%4)+1)), 1, ATTN_NORM, 0); + } + } + // zucc this will fix a jump kick death generating a weapon + self->client->curr_weap = MK23_NUM; + self->deadflag = DEAD_DEAD; - gi.linkentity (self); + gi.linkentity (self); } //======================================================================= @@ -1192,51 +1186,51 @@ but is called after each death and level change in deathmatch */ void InitClientPersistant (gclient_t *client) { - gitem_t *item; + gitem_t *item; - memset (&client->pers, 0, sizeof(client->pers)); - // changed to mk23 - item = FindItem(MK23_NAME); - client->pers.selected_item = ITEM_INDEX(item); - client->pers.inventory[client->pers.selected_item] = 1; - - client->pers.weapon = item; + memset (&client->pers, 0, sizeof(client->pers)); + // changed to mk23 + item = FindItem(MK23_NAME); + client->pers.selected_item = ITEM_INDEX(item); + client->pers.inventory[client->pers.selected_item] = 1; + + client->pers.weapon = item; - item = FindItem(KNIFE_NAME); - client->pers.inventory[ITEM_INDEX(item)] = 1; + item = FindItem(KNIFE_NAME); + client->pers.inventory[ITEM_INDEX(item)] = 1; - client->pers.health = 100; - client->pers.max_health = 100; - //zucc changed maximum ammo amounts - client->pers.max_bullets = 2; - client->pers.max_shells = 14; - client->pers.max_rockets = 2; - client->pers.max_grenades = 50; - client->pers.max_cells = 1; - client->pers.max_slugs = 20; - client->knife_max = 10; - client->grenade_max = 2; + client->pers.health = 100; + client->pers.max_health = 100; + //zucc changed maximum ammo amounts + client->pers.max_bullets = 2; + client->pers.max_shells = 14; + client->pers.max_rockets = 2; + client->pers.max_grenades = 50; + client->pers.max_cells = 1; + client->pers.max_slugs = 20; + client->knife_max = 10; + client->grenade_max = 2; - client->pers.connected = true; - //zucc - client->fired = 0; - client->burst = 0; - client->fast_reload = 0; - client->machinegun_shots = 0; - client->unique_weapon_total = 0; - client->unique_item_total = 0; - client->curr_weap = MK23_NUM; + client->pers.connected = true; + //zucc + client->fired = 0; + client->burst = 0; + client->fast_reload = 0; + client->machinegun_shots = 0; + client->unique_weapon_total = 0; + client->unique_item_total = 0; + client->curr_weap = MK23_NUM; } void InitClientResp (gclient_t *client) { - memset (&client->resp, 0, sizeof(client->resp)); - client->resp.enterframe = level.framenum; - client->resp.coop_respawn = client->pers; - client->resp.weapon = FindItem(MP5_NAME); - client->resp.item = FindItem(KEV_NAME); - client->resp.ir = 1; + memset (&client->resp, 0, sizeof(client->resp)); + client->resp.enterframe = level.framenum; + client->resp.coop_respawn = client->pers; + client->resp.weapon = FindItem(MP5_NAME); + client->resp.item = FindItem(KEV_NAME); + client->resp.ir = 1; } /* @@ -1251,30 +1245,30 @@ edicts are wiped. */ void SaveClientData (void) { - int i; - edict_t *ent; + int i; + edict_t *ent; - for (i=0 ; iinuse) - continue; - game.clients[i].pers.health = ent->health; - game.clients[i].pers.max_health = ent->max_health; - game.clients[i].pers.powerArmorActive = (ent->flags & FL_POWER_ARMOR); - if (coop->value) - game.clients[i].pers.score = ent->client->resp.score; - } + for (i=0 ; iinuse) + continue; + game.clients[i].pers.health = ent->health; + game.clients[i].pers.max_health = ent->max_health; + game.clients[i].pers.powerArmorActive = (ent->flags & FL_POWER_ARMOR); + if (coop->value) + game.clients[i].pers.score = ent->client->resp.score; + } } void FetchClientEntData (edict_t *ent) { - ent->health = ent->client->pers.health; - ent->max_health = ent->client->pers.max_health; - if (ent->client->pers.powerArmorActive) - ent->flags |= FL_POWER_ARMOR; - if (coop->value) - ent->client->resp.score = ent->client->pers.score; + ent->health = ent->client->pers.health; + ent->max_health = ent->client->pers.max_health; + if (ent->client->pers.powerArmorActive) + ent->flags |= FL_POWER_ARMOR; + if (coop->value) + ent->client->resp.score = ent->client->pers.score; } @@ -1296,33 +1290,33 @@ Returns the distance to the nearest player from the given spot */ float PlayersRangeFromSpot (edict_t *spot) { - edict_t *player; - float bestplayerdistance; - vec3_t v; - int n; - float playerdistance; + edict_t *player; + float bestplayerdistance; + vec3_t v; + int n; + float playerdistance; - bestplayerdistance = 9999999; + bestplayerdistance = 9999999; - for (n = 1; n <= maxclients->value; n++) - { - player = &g_edicts[n]; + for (n = 1; n <= maxclients->value; n++) + { + player = &g_edicts[n]; - if (!player->inuse) - continue; + if (!player->inuse) + continue; - if (player->health <= 0) - continue; + if (player->health <= 0) + continue; - VectorSubtract (spot->s.origin, player->s.origin, v); - playerdistance = VectorLength (v); + VectorSubtract (spot->s.origin, player->s.origin, v); + playerdistance = VectorLength (v); - if (playerdistance < bestplayerdistance) - bestplayerdistance = playerdistance; - } + if (playerdistance < bestplayerdistance) + bestplayerdistance = playerdistance; + } - return bestplayerdistance; + return bestplayerdistance; } /* @@ -1335,52 +1329,52 @@ to other players */ edict_t *SelectRandomDeathmatchSpawnPoint (void) { - edict_t *spot, *spot1, *spot2; - int count = 0; - int selection; - float range, range1, range2; + edict_t *spot, *spot1, *spot2; + int count = 0; + int selection; + float range, range1, range2; - spot = NULL; - range1 = range2 = 99999; - spot1 = spot2 = NULL; + spot = NULL; + range1 = range2 = 99999; + spot1 = spot2 = NULL; - while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) - { - count++; - range = PlayersRangeFromSpot(spot); - if (range < range1) - { - range1 = range; - spot1 = spot; - } - else if (range < range2) - { - range2 = range; - spot2 = spot; - } - } + while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) + { + count++; + range = PlayersRangeFromSpot(spot); + if (range < range1) + { + range1 = range; + spot1 = spot; + } + else if (range < range2) + { + range2 = range; + spot2 = spot; + } + } - if (!count) - return NULL; + if (!count) + return NULL; - if (count <= 2) - { - spot1 = spot2 = NULL; - } - else - count -= 2; + if (count <= 2) + { + spot1 = spot2 = NULL; + } + else + count -= 2; - selection = rand() % count; + selection = rand() % count; - spot = NULL; - do - { - spot = G_Find (spot, FOFS(classname), "info_player_deathmatch"); - if (spot == spot1 || spot == spot2) - selection++; - } while(selection--); + spot = NULL; + do + { + spot = G_Find (spot, FOFS(classname), "info_player_deathmatch"); + if (spot == spot1 || spot == spot2) + selection++; + } while(selection--); - return spot; + return spot; } /* @@ -1391,80 +1385,80 @@ SelectFarthestDeathmatchSpawnPoint */ edict_t *SelectFarthestDeathmatchSpawnPoint (void) { - edict_t *bestspot; - float bestdistance, bestplayerdistance; - edict_t *spot; + edict_t *bestspot; + float bestdistance, bestplayerdistance; + edict_t *spot; - spot = NULL; - bestspot = NULL; - bestdistance = 0; - while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) - { - bestplayerdistance = PlayersRangeFromSpot (spot); + spot = NULL; + bestspot = NULL; + bestdistance = 0; + while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) + { + bestplayerdistance = PlayersRangeFromSpot (spot); - if (bestplayerdistance > bestdistance) - { - bestspot = spot; - bestdistance = bestplayerdistance; - } - } + if (bestplayerdistance > bestdistance) + { + bestspot = spot; + bestdistance = bestplayerdistance; + } + } - if (bestspot) - { - return bestspot; - } + if (bestspot) + { + return bestspot; + } - // if there is a player just spawned on each and every start spot - // we have no choice to turn one into a telefrag meltdown - spot = G_Find (NULL, FOFS(classname), "info_player_deathmatch"); + // if there is a player just spawned on each and every start spot + // we have no choice to turn one into a telefrag meltdown + spot = G_Find (NULL, FOFS(classname), "info_player_deathmatch"); - return spot; + return spot; } edict_t *SelectDeathmatchSpawnPoint (void) { - if ( (int)(dmflags->value) & DF_SPAWN_FARTHEST) - return SelectFarthestDeathmatchSpawnPoint (); - else - return SelectRandomDeathmatchSpawnPoint (); + if ( (int)(dmflags->value) & DF_SPAWN_FARTHEST) + return SelectFarthestDeathmatchSpawnPoint (); + else + return SelectRandomDeathmatchSpawnPoint (); } edict_t *SelectCoopSpawnPoint (edict_t *ent) { - int index; - edict_t *spot = NULL; - char *target; + int index; + edict_t *spot = NULL; + char *target; - index = ent->client - game.clients; + index = ent->client - game.clients; - // player 0 starts in normal player spawn point - if (!index) - return NULL; + // player 0 starts in normal player spawn point + if (!index) + return NULL; - spot = NULL; + spot = NULL; - // assume there are four coop spots at each spawnpoint - while (1) - { - spot = G_Find (spot, FOFS(classname), "info_player_coop"); - if (!spot) - return NULL; // we didn't have enough... + // assume there are four coop spots at each spawnpoint + while (1) + { + spot = G_Find (spot, FOFS(classname), "info_player_coop"); + if (!spot) + return NULL; // we didn't have enough... - target = spot->targetname; - if (!target) - target = ""; - if ( Q_stricmp(game.spawnpoint, target) == 0 ) - { // this is a coop spawn point for one of the clients here - index--; - if (!index) - return spot; // this is it - } - } + target = spot->targetname; + if (!target) + target = ""; + if ( Q_stricmp(game.spawnpoint, target) == 0 ) + { // this is a coop spawn point for one of the clients here + index--; + if (!index) + return spot; // this is it + } + } - return spot; + return spot; } @@ -1477,57 +1471,57 @@ Chooses a player start, deathmatch start, coop start, etc */ void SelectSpawnPoint (edict_t *ent, vec3_t origin, vec3_t angles) { - edict_t *spot = NULL; + edict_t *spot = NULL; //FIREBLADE - if (teamplay->value && ent->client->resp.team != NOTEAM) - { - spot = SelectTeamplaySpawnPoint(ent); - } - else - { + if (teamplay->value && ent->client->resp.team != NOTEAM) + { + spot = SelectTeamplaySpawnPoint(ent); + } + else + { //FIREBLADE - if (deathmatch->value) - spot = SelectDeathmatchSpawnPoint (); - else if (coop->value) - spot = SelectCoopSpawnPoint (ent); - } + if (deathmatch->value) + spot = SelectDeathmatchSpawnPoint (); + else if (coop->value) + spot = SelectCoopSpawnPoint (ent); + } - // find a single player start spot - if (!spot) - { + // find a single player start spot + if (!spot) + { //FIREBLADE - if (deathmatch->value) - { - gi.dprintf("Warning: failed to find deathmatch spawn point\n"); - } + if (deathmatch->value) + { + gi.dprintf("Warning: failed to find deathmatch spawn point\n"); + } //FIREBLADE - while ((spot = G_Find (spot, FOFS(classname), "info_player_start")) != NULL) - { - if (!game.spawnpoint[0] && !spot->targetname) - break; + while ((spot = G_Find (spot, FOFS(classname), "info_player_start")) != NULL) + { + if (!game.spawnpoint[0] && !spot->targetname) + break; - if (!game.spawnpoint[0] || !spot->targetname) - continue; + if (!game.spawnpoint[0] || !spot->targetname) + continue; - if (Q_stricmp(game.spawnpoint, spot->targetname) == 0) - break; - } + if (Q_stricmp(game.spawnpoint, spot->targetname) == 0) + break; + } - if (!spot) - { - if (!game.spawnpoint[0]) - { // there wasn't a spawnpoint without a target, so use any - spot = G_Find (spot, FOFS(classname), "info_player_start"); - } - if (!spot) - gi.error ("Couldn't find spawn point %s\n", game.spawnpoint); - } - } + if (!spot) + { + if (!game.spawnpoint[0]) + { // there wasn't a spawnpoint without a target, so use any + spot = G_Find (spot, FOFS(classname), "info_player_start"); + } + if (!spot) + gi.error ("Couldn't find spawn point %s\n", game.spawnpoint); + } + } - VectorCopy (spot->s.origin, origin); - origin[2] += 9; - VectorCopy (spot->s.angles, angles); + VectorCopy (spot->s.origin, origin); + origin[2] += 9; + VectorCopy (spot->s.angles, angles); } //====================================================================== @@ -1535,97 +1529,97 @@ void SelectSpawnPoint (edict_t *ent, vec3_t origin, vec3_t angles) void InitBodyQue (void) { - int i; - edict_t *ent; + int i; + edict_t *ent; - level.body_que = 0; - for (i=0; iclassname = "bodyque"; - } + level.body_que = 0; + for (i=0; iclassname = "bodyque"; + } } void body_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { /* int n;*/ - if (self->health < -40) - { - // remove gibbing + if (self->health < -40) + { + // remove gibbing /* gi.sound (self, CHAN_BODY, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); - for (n= 0; n < 4; n++) - ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); - self->s.origin[2] -= 48; - ThrowClientHead (self, damage);*/ - self->takedamage = DAMAGE_NO; - } + for (n= 0; n < 4; n++) + ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); + self->s.origin[2] -= 48; + ThrowClientHead (self, damage);*/ + self->takedamage = DAMAGE_NO; + } } void CopyToBodyQue (edict_t *ent) { - edict_t *body; + edict_t *body; - // grab a body que and cycle to the next one - body = &g_edicts[(int)maxclients->value + level.body_que + 1]; - level.body_que = (level.body_que + 1) % BODY_QUEUE_SIZE; + // grab a body que and cycle to the next one + body = &g_edicts[(int)maxclients->value + level.body_que + 1]; + level.body_que = (level.body_que + 1) % BODY_QUEUE_SIZE; - // FIXME: send an effect on the removed body + // FIXME: send an effect on the removed body - gi.unlinkentity (ent); + gi.unlinkentity (ent); - gi.unlinkentity (body); - body->s = ent->s; - body->s.number = body - g_edicts; + gi.unlinkentity (body); + body->s = ent->s; + body->s.number = body - g_edicts; - body->svflags = ent->svflags; - VectorCopy (ent->mins, body->mins); - VectorCopy (ent->maxs, body->maxs); - VectorCopy (ent->absmin, body->absmin); - VectorCopy (ent->absmax, body->absmax); - VectorCopy (ent->size, body->size); - // All our bodies will be non-solid -FB - body->solid = SOLID_NOT; - //body->solid = ent->solid; - body->clipmask = ent->clipmask; - body->owner = ent->owner; - body->movetype = ent->movetype; + body->svflags = ent->svflags; + VectorCopy (ent->mins, body->mins); + VectorCopy (ent->maxs, body->maxs); + VectorCopy (ent->absmin, body->absmin); + VectorCopy (ent->absmax, body->absmax); + VectorCopy (ent->size, body->size); + // All our bodies will be non-solid -FB + body->solid = SOLID_NOT; + //body->solid = ent->solid; + body->clipmask = ent->clipmask; + body->owner = ent->owner; + body->movetype = ent->movetype; - body->die = body_die; - body->takedamage = DAMAGE_YES; + body->die = body_die; + body->takedamage = DAMAGE_YES; - gi.linkentity (body); + gi.linkentity (body); } void CleanBodies() { - edict_t *ptr; - int i; - ptr = g_edicts + game.maxclients + 1; - i = 0; - while (i < BODY_QUEUE_SIZE) - { - gi.unlinkentity(ptr); - ptr->solid = SOLID_NOT; - ptr->movetype = MOVETYPE_NOCLIP; - ptr->svflags |= SVF_NOCLIENT; - ptr++; - i++; - } + edict_t *ptr; + int i; + ptr = g_edicts + game.maxclients + 1; + i = 0; + while (i < BODY_QUEUE_SIZE) + { + gi.unlinkentity(ptr); + ptr->solid = SOLID_NOT; + ptr->movetype = MOVETYPE_NOCLIP; + ptr->svflags |= SVF_NOCLIENT; + ptr++; + i++; + } } void respawn (edict_t *self) { - if (deathmatch->value || coop->value) - { + if (deathmatch->value || coop->value) + { //FIREBLADE - if (self->solid != SOLID_NOT || self->deadflag == DEAD_DEAD) + if (self->solid != SOLID_NOT || self->deadflag == DEAD_DEAD) //FIREBLADE - CopyToBodyQue (self); - PutClientInServer (self); + CopyToBodyQue (self); + PutClientInServer (self); //FIREBLADE - self->svflags &= ~SVF_NOCLIENT; + self->svflags &= ~SVF_NOCLIENT; //FIREBLADE // Disable all this... -FB @@ -1636,13 +1630,13 @@ void respawn (edict_t *self) // self->client->ps.pmove.pm_flags = PMF_TIME_TELEPORT; // self->client->ps.pmove.pm_time = 14; - self->client->respawn_time = level.time; + self->client->respawn_time = level.time; - return; - } + return; + } - // restart the entire server - gi.AddCommandString ("menu_loadgame\n"); + // restart the entire server + gi.AddCommandString ("menu_loadgame\n"); } //============================================================== @@ -1650,70 +1644,70 @@ void respawn (edict_t *self) void AllWeapons( edict_t *ent ) { - int i; - gitem_t *it; + int i; + gitem_t *it; - for (i=0 ; ipickup) - continue; - if (!(it->flags & IT_WEAPON)) - continue; - ent->client->pers.inventory[i] = 1; - } + for (i=0 ; ipickup) + continue; + if (!(it->flags & IT_WEAPON)) + continue; + ent->client->pers.inventory[i] = 1; + } - for (i=0 ; ipickup) - continue; - if (!(it->flags & IT_AMMO)) - continue; - Add_Ammo (ent, it, 1000); - } + for (i=0 ; ipickup) + continue; + if (!(it->flags & IT_AMMO)) + continue; + Add_Ammo (ent, it, 1000); + } - ent->client->mk23_rds = ent->client->mk23_max; - ent->client->dual_rds = ent->client->dual_max; - ent->client->mp5_rds = ent->client->mp5_max; - ent->client->m4_rds = ent->client->m4_max; - ent->client->shot_rds = ent->client->shot_max; - ent->client->sniper_rds = ent->client->sniper_max; - ent->client->cannon_rds = ent->client->cannon_max; + ent->client->mk23_rds = ent->client->mk23_max; + ent->client->dual_rds = ent->client->dual_max; + ent->client->mp5_rds = ent->client->mp5_max; + ent->client->m4_rds = ent->client->m4_max; + ent->client->shot_rds = ent->client->shot_max; + ent->client->sniper_rds = ent->client->sniper_max; + ent->client->cannon_rds = ent->client->cannon_max; - if (!tgren->value) // team grenades is turned off - { - it = FindItem(GRENADE_NAME); - ent->client->pers.inventory[ITEM_INDEX(it)] = 0; - } - // give them a reasonable number of knives - it = FindItem(KNIFE_NAME); - ent->client->pers.inventory[ITEM_INDEX(it)] = 10; + if (tgren->value <= 0) // team grenades is turned off + { + it = FindItem(GRENADE_NAME); + ent->client->pers.inventory[ITEM_INDEX(it)] = 0; + } + // give them a reasonable number of knives + it = FindItem(KNIFE_NAME); + ent->client->pers.inventory[ITEM_INDEX(it)] = 10; } void AllItems( edict_t *ent ) { - edict_t etemp; - int i; - gitem_t *it; - - + edict_t etemp; + int i; + gitem_t *it; + + - for (i=0 ; ipickup) - continue; - if (!(it->flags & IT_ITEM)) - continue; - - etemp.item = it; - - if ( ent->client->unique_item_total >= unique_items->value ) - ent->client->unique_item_total = unique_items->value - 1; - Pickup_Special ( &etemp, ent ); - } + for (i=0 ; ipickup) + continue; + if (!(it->flags & IT_ITEM)) + continue; + + etemp.item = it; + + if ( ent->client->unique_item_total >= unique_items->value ) + ent->client->unique_item_total = unique_items->value - 1; + Pickup_Special ( &etemp, ent ); + } } @@ -1724,137 +1718,137 @@ void AllItems( edict_t *ent ) void EquipClient( edict_t *ent ) { - gclient_t *client; - gitem_t* item; - edict_t etemp; - int band = 0; + gclient_t *client; + gitem_t* item; + edict_t etemp; + int band = 0; - client = ent->client; - - - if ( !(client->resp.item) || !(client->resp.weapon) ) - return; - + client = ent->client; + + + if ( !(client->resp.item) || !(client->resp.weapon) ) + return; + - if ( stricmp(client->resp.item->pickup_name, BAND_NAME) == 0 ) - { - band = 1; - if (tgren->value) // team grenades is turned on - { - item = FindItem(GRENADE_NAME); - client->pers.inventory[ITEM_INDEX(item)] = tgren->value; - } - - } + if ( stricmp(client->resp.item->pickup_name, BAND_NAME) == 0 ) + { + band = 1; + if (tgren->value > 0) // team grenades is turned on + { + item = FindItem(GRENADE_NAME); + client->pers.inventory[ITEM_INDEX(item)] = tgren->value; + } + + } - // set them up with initial pistol ammo - item = FindItem("Pistol Clip"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 2; - else - client->pers.inventory[ITEM_INDEX(item)] = 1; - + // set them up with initial pistol ammo + item = FindItem("Pistol Clip"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 2; + else + client->pers.inventory[ITEM_INDEX(item)] = 1; + - if ( stricmp(client->resp.weapon->pickup_name, MP5_NAME ) == 0 ) - { - item = FindItem(MP5_NAME); - client->pers.selected_item = ITEM_INDEX(item); - client->pers.inventory[client->pers.selected_item] = 1; - client->pers.weapon = item; - client->curr_weap = MP5_NUM; - client->unique_weapon_total = 1; - item = FindItem("Machinegun Magazine"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 2; - else - client->pers.inventory[ITEM_INDEX(item)] = 1; - client->mp5_rds = client->mp5_max; - } - else if ( stricmp(client->resp.weapon->pickup_name, M4_NAME ) == 0 ) - { - item = FindItem(M4_NAME); - client->pers.selected_item = ITEM_INDEX(item); - client->pers.inventory[client->pers.selected_item] = 1; - client->pers.weapon = item; - client->curr_weap = M4_NUM; - client->unique_weapon_total = 1; - item = FindItem("M4 Clip"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 2; - else - client->pers.inventory[ITEM_INDEX(item)] = 1; - client->m4_rds = client->m4_max; - } - else if ( stricmp(client->resp.weapon->pickup_name, M3_NAME ) == 0 ) - { - item = FindItem(M3_NAME); - client->pers.selected_item = ITEM_INDEX(item); - client->pers.inventory[client->pers.selected_item] = 1; - client->pers.weapon = item; - client->curr_weap = M3_NUM; - client->unique_weapon_total = 1; - item = FindItem("12 Gauge Shells"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 14; - else - client->pers.inventory[ITEM_INDEX(item)] = 7; - client->shot_rds = client->shot_max; - } - else if ( stricmp(client->resp.weapon->pickup_name, HC_NAME ) == 0 ) - { - item = FindItem(HC_NAME); - client->pers.selected_item = ITEM_INDEX(item); - client->pers.inventory[client->pers.selected_item] = 1; - client->pers.weapon = item; - client->curr_weap = HC_NUM; - client->unique_weapon_total = 1; - item = FindItem("12 Gauge Shells"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 24; - else - client->pers.inventory[ITEM_INDEX(item)] = 12; - client->cannon_rds = client->cannon_max; - } - else if ( stricmp(client->resp.weapon->pickup_name, SNIPER_NAME ) == 0 ) - { - item = FindItem(SNIPER_NAME); - client->pers.inventory[ITEM_INDEX(item)] = 1; - client->unique_weapon_total = 1; - item = FindItem("AP Sniper Ammo"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 20; - else - client->pers.inventory[ITEM_INDEX(item)] = 10; - client->sniper_rds = client->sniper_max; - } - else if ( stricmp(client->resp.weapon->pickup_name, DUAL_NAME ) == 0 ) - { - item = FindItem(DUAL_NAME); - client->pers.selected_item = ITEM_INDEX(item); - client->pers.inventory[client->pers.selected_item] = 1; - client->pers.weapon = item; - client->curr_weap = DUAL_NUM; - item = FindItem("Pistol Clip"); - if ( band ) - client->pers.inventory[ITEM_INDEX(item)] = 4; - else - client->pers.inventory[ITEM_INDEX(item)] = 2; - client->dual_rds = client->dual_max; - } - else if ( stricmp(client->resp.weapon->pickup_name, KNIFE_NAME ) == 0 ) - { - item = FindItem(KNIFE_NAME); - client->pers.selected_item = ITEM_INDEX(item); - if ( band ) - client->pers.inventory[client->pers.selected_item] = 20; - else - client->pers.inventory[client->pers.selected_item] = 10; - client->pers.weapon = item; - client->curr_weap = KNIFE_NUM; - } - - etemp.item = client->resp.item; - Pickup_Special ( &etemp, ent ); + if ( stricmp(client->resp.weapon->pickup_name, MP5_NAME ) == 0 ) + { + item = FindItem(MP5_NAME); + client->pers.selected_item = ITEM_INDEX(item); + client->pers.inventory[client->pers.selected_item] = 1; + client->pers.weapon = item; + client->curr_weap = MP5_NUM; + client->unique_weapon_total = 1; + item = FindItem("Machinegun Magazine"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 2; + else + client->pers.inventory[ITEM_INDEX(item)] = 1; + client->mp5_rds = client->mp5_max; + } + else if ( stricmp(client->resp.weapon->pickup_name, M4_NAME ) == 0 ) + { + item = FindItem(M4_NAME); + client->pers.selected_item = ITEM_INDEX(item); + client->pers.inventory[client->pers.selected_item] = 1; + client->pers.weapon = item; + client->curr_weap = M4_NUM; + client->unique_weapon_total = 1; + item = FindItem("M4 Clip"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 2; + else + client->pers.inventory[ITEM_INDEX(item)] = 1; + client->m4_rds = client->m4_max; + } + else if ( stricmp(client->resp.weapon->pickup_name, M3_NAME ) == 0 ) + { + item = FindItem(M3_NAME); + client->pers.selected_item = ITEM_INDEX(item); + client->pers.inventory[client->pers.selected_item] = 1; + client->pers.weapon = item; + client->curr_weap = M3_NUM; + client->unique_weapon_total = 1; + item = FindItem("12 Gauge Shells"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 14; + else + client->pers.inventory[ITEM_INDEX(item)] = 7; + client->shot_rds = client->shot_max; + } + else if ( stricmp(client->resp.weapon->pickup_name, HC_NAME ) == 0 ) + { + item = FindItem(HC_NAME); + client->pers.selected_item = ITEM_INDEX(item); + client->pers.inventory[client->pers.selected_item] = 1; + client->pers.weapon = item; + client->curr_weap = HC_NUM; + client->unique_weapon_total = 1; + item = FindItem("12 Gauge Shells"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 24; + else + client->pers.inventory[ITEM_INDEX(item)] = 12; + client->cannon_rds = client->cannon_max; + } + else if ( stricmp(client->resp.weapon->pickup_name, SNIPER_NAME ) == 0 ) + { + item = FindItem(SNIPER_NAME); + client->pers.inventory[ITEM_INDEX(item)] = 1; + client->unique_weapon_total = 1; + item = FindItem("AP Sniper Ammo"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 20; + else + client->pers.inventory[ITEM_INDEX(item)] = 10; + client->sniper_rds = client->sniper_max; + } + else if ( stricmp(client->resp.weapon->pickup_name, DUAL_NAME ) == 0 ) + { + item = FindItem(DUAL_NAME); + client->pers.selected_item = ITEM_INDEX(item); + client->pers.inventory[client->pers.selected_item] = 1; + client->pers.weapon = item; + client->curr_weap = DUAL_NUM; + item = FindItem("Pistol Clip"); + if ( band ) + client->pers.inventory[ITEM_INDEX(item)] = 4; + else + client->pers.inventory[ITEM_INDEX(item)] = 2; + client->dual_rds = client->dual_max; + } + else if ( stricmp(client->resp.weapon->pickup_name, KNIFE_NAME ) == 0 ) + { + item = FindItem(KNIFE_NAME); + client->pers.selected_item = ITEM_INDEX(item); + if ( band ) + client->pers.inventory[client->pers.selected_item] = 20; + else + client->pers.inventory[client->pers.selected_item] = 10; + client->pers.weapon = item; + client->curr_weap = KNIFE_NUM; + } + + etemp.item = client->resp.item; + Pickup_Special ( &etemp, ent ); } @@ -1872,243 +1866,243 @@ a deathmatch. void PutClientInServer (edict_t *ent) { - vec3_t mins = {-16, -16, -24}; - vec3_t maxs = {16, 16, 32}; - int index; - vec3_t spawn_origin, spawn_angles; - gclient_t *client; - int going_observer; - int i; - client_persistant_t saved; - client_respawn_t resp; - // zucc for ammo + vec3_t mins = {-16, -16, -24}; + vec3_t maxs = {16, 16, 32}; + int index; + vec3_t spawn_origin, spawn_angles; + gclient_t *client; + int going_observer; + int i; + client_persistant_t saved; + client_respawn_t resp; + // zucc for ammo // gitem_t *item; - // find a spawn point - // do it before setting health back up, so farthest - // ranging doesn't count this client - SelectSpawnPoint (ent, spawn_origin, spawn_angles); + // find a spawn point + // do it before setting health back up, so farthest + // ranging doesn't count this client + SelectSpawnPoint (ent, spawn_origin, spawn_angles); - index = ent-g_edicts-1; - client = ent->client; + index = ent-g_edicts-1; + client = ent->client; - // deathmatch wipes most client data every spawn - if (deathmatch->value) - { - char userinfo[MAX_INFO_STRING]; + // deathmatch wipes most client data every spawn + if (deathmatch->value) + { + char userinfo[MAX_INFO_STRING]; - resp = client->resp; - memcpy (userinfo, client->pers.userinfo, sizeof(userinfo)); - InitClientPersistant (client); - ClientUserinfoChanged (ent, userinfo); - } - else if (coop->value) - { - int n; - char userinfo[MAX_INFO_STRING]; + resp = client->resp; + memcpy (userinfo, client->pers.userinfo, sizeof(userinfo)); + InitClientPersistant (client); + ClientUserinfoChanged (ent, userinfo); + } + else if (coop->value) + { + int n; + char userinfo[MAX_INFO_STRING]; - resp = client->resp; - memcpy (userinfo, client->pers.userinfo, sizeof(userinfo)); - // this is kind of ugly, but it's how we want to handle keys in coop - for (n = 0; n < MAX_ITEMS; n++) - { - if (itemlist[n].flags & IT_KEY) - resp.coop_respawn.inventory[n] = client->pers.inventory[n]; - } - client->pers = resp.coop_respawn; - ClientUserinfoChanged (ent, userinfo); - if (resp.score > client->pers.score) - client->pers.score = resp.score; - } - else - { - memset (&resp, 0, sizeof(resp)); - } + resp = client->resp; + memcpy (userinfo, client->pers.userinfo, sizeof(userinfo)); + // this is kind of ugly, but it's how we want to handle keys in coop + for (n = 0; n < MAX_ITEMS; n++) + { + if (itemlist[n].flags & IT_KEY) + resp.coop_respawn.inventory[n] = client->pers.inventory[n]; + } + client->pers = resp.coop_respawn; + ClientUserinfoChanged (ent, userinfo); + if (resp.score > client->pers.score) + client->pers.score = resp.score; + } + else + { + memset (&resp, 0, sizeof(resp)); + } - // clear everything but the persistant data - saved = client->pers; - memset (client, 0, sizeof(*client)); - client->pers = saved; - if (client->pers.health <= 0) - InitClientPersistant(client); - client->resp = resp; + // clear everything but the persistant data + saved = client->pers; + memset (client, 0, sizeof(*client)); + client->pers = saved; + if (client->pers.health <= 0) + InitClientPersistant(client); + client->resp = resp; - // copy some data from the client to the entity - FetchClientEntData (ent); + // copy some data from the client to the entity + FetchClientEntData (ent); - // clear entity values - ent->groundentity = NULL; - ent->client = &game.clients[index]; - ent->takedamage = DAMAGE_AIM; - ent->movetype = MOVETYPE_WALK; - ent->viewheight = 22; - ent->inuse = true; - ent->classname = "player"; - ent->mass = 200; - ent->solid = SOLID_BBOX; - ent->deadflag = DEAD_NO; - ent->air_finished = level.time + 12; - ent->clipmask = MASK_PLAYERSOLID; - ent->model = "players/male/tris.md2"; - ent->pain = player_pain; - ent->die = player_die; - ent->waterlevel = 0; - ent->watertype = 0; - ent->flags &= ~FL_NO_KNOCKBACK; - ent->svflags &= ~SVF_DEADMONSTER; + // clear entity values + ent->groundentity = NULL; + ent->client = &game.clients[index]; + ent->takedamage = DAMAGE_AIM; + ent->movetype = MOVETYPE_WALK; + ent->viewheight = 22; + ent->inuse = true; + ent->classname = "player"; + ent->mass = 200; + ent->solid = SOLID_BBOX; + ent->deadflag = DEAD_NO; + ent->air_finished = level.time + 12; + ent->clipmask = MASK_PLAYERSOLID; + ent->model = "players/male/tris.md2"; + ent->pain = player_pain; + ent->die = player_die; + ent->waterlevel = 0; + ent->watertype = 0; + ent->flags &= ~FL_NO_KNOCKBACK; + ent->svflags &= ~SVF_DEADMONSTER; //FIREBLADE - if (!teamplay->value || ent->client->resp.team != NOTEAM) - { - ent->flags &= ~FL_GODMODE; - ent->svflags &= ~SVF_NOCLIENT; - } + if (!teamplay->value || ent->client->resp.team != NOTEAM) + { + ent->flags &= ~FL_GODMODE; + ent->svflags &= ~SVF_NOCLIENT; + } //FIREBLADE - VectorCopy (mins, ent->mins); - VectorCopy (maxs, ent->maxs); - VectorClear (ent->velocity); + VectorCopy (mins, ent->mins); + VectorCopy (maxs, ent->maxs); + VectorClear (ent->velocity); - // clear playerstate values - memset (&ent->client->ps, 0, sizeof(client->ps)); + // clear playerstate values + memset (&ent->client->ps, 0, sizeof(client->ps)); - client->ps.pmove.origin[0] = spawn_origin[0]*8; - client->ps.pmove.origin[1] = spawn_origin[1]*8; - client->ps.pmove.origin[2] = spawn_origin[2]*8; + client->ps.pmove.origin[0] = spawn_origin[0]*8; + client->ps.pmove.origin[1] = spawn_origin[1]*8; + client->ps.pmove.origin[2] = spawn_origin[2]*8; - if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) - { - client->ps.fov = 90; - } - else - { - client->ps.fov = atoi(Info_ValueForKey(client->pers.userinfo, "fov")); - if (client->ps.fov < 1) - client->ps.fov = 90; - else if (client->ps.fov > 160) - client->ps.fov = 160; - } + if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) + { + client->ps.fov = 90; + } + else + { + client->ps.fov = atoi(Info_ValueForKey(client->pers.userinfo, "fov")); + if (client->ps.fov < 1) + client->ps.fov = 90; + else if (client->ps.fov > 160) + client->ps.fov = 160; + } - client->ps.gunindex = gi.modelindex(client->pers.weapon->view_model); + client->ps.gunindex = gi.modelindex(client->pers.weapon->view_model); - // clear entity state values - ent->s.effects = 0; - ent->s.skinnum = ent - g_edicts - 1; - ent->s.modelindex = 255; // will use the skin specified model - - // zucc vwep - //ent->s.modelindex2 = 255; // custom gun model - ShowGun(ent); - - ent->s.frame = 0; - VectorCopy (spawn_origin, ent->s.origin); - ent->s.origin[2] += 1; // make sure off ground - VectorCopy (ent->s.origin, ent->s.old_origin); + // clear entity state values + ent->s.effects = 0; + ent->s.skinnum = ent - g_edicts - 1; + ent->s.modelindex = 255; // will use the skin specified model + + // zucc vwep + //ent->s.modelindex2 = 255; // custom gun model + ShowGun(ent); + + ent->s.frame = 0; + VectorCopy (spawn_origin, ent->s.origin); + ent->s.origin[2] += 1; // make sure off ground + VectorCopy (ent->s.origin, ent->s.old_origin); - // set the delta angle - for (i=0 ; i<3 ; i++) - client->ps.pmove.delta_angles[i] = ANGLE2SHORT(spawn_angles[i] - client->resp.cmd_angles[i]); + // set the delta angle + for (i=0 ; i<3 ; i++) + client->ps.pmove.delta_angles[i] = ANGLE2SHORT(spawn_angles[i] - client->resp.cmd_angles[i]); - ent->s.angles[PITCH] = 0; - ent->s.angles[YAW] = spawn_angles[YAW]; - ent->s.angles[ROLL] = 0; - VectorCopy (ent->s.angles, client->ps.viewangles); - VectorCopy (ent->s.angles, client->v_angle); + ent->s.angles[PITCH] = 0; + ent->s.angles[YAW] = spawn_angles[YAW]; + ent->s.angles[ROLL] = 0; + VectorCopy (ent->s.angles, client->ps.viewangles); + VectorCopy (ent->s.angles, client->v_angle); //FIREBLADE - if (teamplay->value) - { - going_observer = StartClient(ent); - } - else - { - going_observer = ent->client->pers.spectator; - if (going_observer) - { - ent->movetype = MOVETYPE_NOCLIP; - ent->solid = SOLID_NOT; - ent->svflags |= SVF_NOCLIENT; - ent->client->resp.team = NOTEAM; - ent->client->ps.gunindex = 0; - } - } + if (teamplay->value) + { + going_observer = StartClient(ent); + } + else + { + going_observer = ent->client->pers.spectator; + if (going_observer) + { + ent->movetype = MOVETYPE_NOCLIP; + ent->solid = SOLID_NOT; + ent->svflags |= SVF_NOCLIENT; + ent->client->resp.team = NOTEAM; + ent->client->ps.gunindex = 0; + } + } //FIREBLADE - if (!going_observer && !teamplay->value) - { // this handles telefrags... - KillBox(ent); - } + if (!going_observer && !teamplay->value) + { // this handles telefrags... + KillBox(ent); + } //FIREBLADE - gi.linkentity (ent); + gi.linkentity (ent); - //zucc give some ammo - //item = FindItem("Pistol Clip"); - // Add_Ammo(ent,item,1); - client->mk23_max = 12; - client->mp5_max = 30; - client->m4_max = 24; - client->shot_max = 7; - client->sniper_max = 6; - client->cannon_max = 2; - client->dual_max = 24; - client->mk23_rds = client->mk23_max; - client->dual_rds = client->mk23_max; - client->knife_max = 10; - client->grenade_max = 2; + //zucc give some ammo + //item = FindItem("Pistol Clip"); + // Add_Ammo(ent,item,1); + client->mk23_max = 12; + client->mp5_max = 30; + client->m4_max = 24; + client->shot_max = 7; + client->sniper_max = 6; + client->cannon_max = 2; + client->dual_max = 24; + client->mk23_rds = client->mk23_max; + client->dual_rds = client->mk23_max; + client->knife_max = 10; + client->grenade_max = 2; - ent->lasersight = NULL; + ent->lasersight = NULL; - //other - client->bandaging = 0; - client->leg_damage = 0; - client->leg_noise = 0; - client->leg_dam_count = 0; - client->desired_fov = 90; - client->ps.fov = 90; - client->idle_weapon = 0; - client->drop_knife = 0; - client->no_sniper_display = 0; - client->knife_sound = 0; - client->doortoggle = 0; - client->have_laser = 0; + //other + client->bandaging = 0; + client->leg_damage = 0; + client->leg_noise = 0; + client->leg_dam_count = 0; + client->desired_fov = 90; + client->ps.fov = 90; + client->idle_weapon = 0; + client->drop_knife = 0; + client->no_sniper_display = 0; + client->knife_sound = 0; + client->doortoggle = 0; + client->have_laser = 0; //FIREBLADE - if (!going_observer) - { + if (!going_observer) + { - // items up here so that the bandolier will change equipclient below - if ( allitem->value ) - { - AllItems( ent ); - } - - - if (teamplay->value) - EquipClient(ent); - - if (ent->client->menu) - { - PMenu_Close(ent); - return; - } + // items up here so that the bandolier will change equipclient below + if ( allitem->value ) + { + AllItems( ent ); + } + + + if (teamplay->value) + EquipClient(ent); + + if (ent->client->menu) + { + PMenu_Close(ent); + return; + } //FIREBLADE - if ( allweapon->value ) - { - AllWeapons( ent ); - } - - // force the current weapon up - client->newweapon = client->pers.weapon; - ChangeWeapon (ent); + if ( allweapon->value ) + { + AllWeapons( ent ); + } + + // force the current weapon up + client->newweapon = client->pers.weapon; + ChangeWeapon (ent); //FIREBLADE - if (teamplay->value) - { - ent->solid = SOLID_TRIGGER; - gi.linkentity(ent); - } + if (teamplay->value) + { + ent->solid = SOLID_TRIGGER; + gi.linkentity(ent); + } //FIREBLADE - } + } } /* @@ -2121,41 +2115,41 @@ deathmatch mode, so clear everything out before starting them. */ void ClientBeginDeathmatch (edict_t *ent) { - G_InitEdict (ent); + G_InitEdict (ent); - InitClientResp (ent->client); + InitClientResp (ent->client); - // locate ent at a spawn point - PutClientInServer (ent); + // locate ent at a spawn point + PutClientInServer (ent); // FROM 3.20 -FB - if (level.intermissiontime) - { - MoveClientToIntermission (ent); - } - else - { + if (level.intermissiontime) + { + MoveClientToIntermission (ent); + } + else + { // ^^^ - // send effect - gi.WriteByte (svc_muzzleflash); - gi.WriteShort (ent-g_edicts); - gi.WriteByte (MZ_LOGIN); - gi.multicast (ent->s.origin, MULTICAST_PVS); - } + // send effect + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (ent-g_edicts); + gi.WriteByte (MZ_LOGIN); + gi.multicast (ent->s.origin, MULTICAST_PVS); + } - gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname); + gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname); //FIREBLADE - if (deathmatch->value && !teamplay->value && ent->solid == SOLID_NOT) - gi.bprintf(PRINT_HIGH, "%s became a spectator\n", ent->client->pers.netname); + if (deathmatch->value && !teamplay->value && ent->solid == SOLID_NOT) + gi.bprintf(PRINT_HIGH, "%s became a spectator\n", ent->client->pers.netname); //FIREBLADE //FIREBLADE - PrintMOTD(ent); - ent->client->resp.motd_refreshes = 1; + PrintMOTD(ent); + ent->client->resp.motd_refreshes = 1; //FIREBLADE - // make sure all view stuff is valid - ClientEndServerFrame (ent); + // make sure all view stuff is valid + ClientEndServerFrame (ent); } @@ -2169,68 +2163,73 @@ to be placed into the game. This will happen every level load. */ void ClientBegin (edict_t *ent) { - int i; + int i; - ent->client = game.clients + (ent - g_edicts - 1); + ent->client = game.clients + (ent - g_edicts - 1); - // clear modes of weapons - /*ent->client->pers.mk23_mode = 0; - ent->client->pers.mp5_mode = 0; - ent->client->pers.m4_mode = 0; - ent->client->pers.sniper_mode = 0; - ent->client->pers.knife_mode = 0; - ent->client->pers.grenade_mode = 0; + // clear modes of weapons + /*ent->client->pers.mk23_mode = 0; + ent->client->pers.mp5_mode = 0; + ent->client->pers.m4_mode = 0; + ent->client->pers.sniper_mode = 0; + ent->client->pers.knife_mode = 0; + ent->client->pers.grenade_mode = 0; */ - if (deathmatch->value) - { - ClientBeginDeathmatch (ent); - return; - } + if (deathmatch->value) + { + ClientBeginDeathmatch (ent); + return; + } - // if there is already a body waiting for us (a loadgame), just - // take it, otherwise spawn one from scratch - if (ent->inuse == true) - { - // the client has cleared the client side viewangles upon - // connecting to the server, which is different than the - // state when the game is saved, so we need to compensate - // with deltaangles - for (i=0 ; i<3 ; i++) - ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(ent->client->ps.viewangles[i]); - } - else - { - // a spawn point will completely reinitialize the entity - // except for the persistant data that was initialized at - // ClientConnect() time - G_InitEdict (ent); - ent->classname = "player"; - InitClientResp (ent->client); - PutClientInServer (ent); - } + // if there is already a body waiting for us (a loadgame), just + // take it, otherwise spawn one from scratch + if (ent->inuse == true) + { + // the client has cleared the client side viewangles upon + // connecting to the server, which is different than the + // state when the game is saved, so we need to compensate + // with deltaangles + for (i=0 ; i<3 ; i++) + ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(ent->client->ps.viewangles[i]); + } + else + { + // a spawn point will completely reinitialize the entity + // except for the persistant data that was initialized at + // ClientConnect() time + G_InitEdict (ent); + ent->classname = "player"; + InitClientResp (ent->client); + PutClientInServer (ent); + } - if (level.intermissiontime) - { - MoveClientToIntermission (ent); - } - else - { - // send effect if in a multiplayer game - if (game.maxclients > 1) - { - gi.WriteByte (svc_muzzleflash); - gi.WriteShort (ent-g_edicts); - gi.WriteByte (MZ_LOGIN); - gi.multicast (ent->s.origin, MULTICAST_PVS); + if (level.intermissiontime) + { + MoveClientToIntermission (ent); + } + else + { + // send effect if in a multiplayer game + if (game.maxclients > 1) + { +//FIREBLADE + if (!teamplay->value) + { +//FIREBLADE + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (ent-g_edicts); + gi.WriteByte (MZ_LOGIN); + gi.multicast (ent->s.origin, MULTICAST_PVS); + } - gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname); - } - } + gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname); + } + } - // make sure all view stuff is valid - ClientEndServerFrame (ent); + // make sure all view stuff is valid + ClientEndServerFrame (ent); } /* @@ -2245,66 +2244,71 @@ The game can override any of the settings in place */ void ClientUserinfoChanged (edict_t *ent, char *userinfo) { - char *s, *r; - int playernum; + char *s, *r; + int playernum; - // check for malformed or illegal info strings - if (!Info_Validate(userinfo)) - { - strcpy (userinfo, "\\name\\badinfo\\skin\\male/grunt"); - } + // check for malformed or illegal info strings + if (!Info_Validate(userinfo)) + { + strcpy (userinfo, "\\name\\badinfo\\skin\\male/grunt"); + } - // set name - s = Info_ValueForKey (userinfo, "name"); - strncpy (ent->client->pers.netname, s, sizeof(ent->client->pers.netname)-1); + // set name + s = Info_ValueForKey (userinfo, "name"); + strncpy (ent->client->pers.netname, s, sizeof(ent->client->pers.netname)-1); //FIREBLADE - s = Info_ValueForKey(userinfo, "spectator"); - ent->client->pers.spectator = (strcmp(s, "0") != 0); + s = Info_ValueForKey(userinfo, "spectator"); + ent->client->pers.spectator = (strcmp(s, "0") != 0); - r = Info_ValueForKey(userinfo, "rate"); - ent->client->rate = atoi(r); + r = Info_ValueForKey(userinfo, "rate"); + ent->client->rate = atoi(r); //FIREBLADE - // set skin - s = Info_ValueForKey (userinfo, "skin"); - playernum = ent-g_edicts-1; + // set skin + s = Info_ValueForKey (userinfo, "skin"); + playernum = ent-g_edicts-1; - // combine name and skin into a configstring + // combine name and skin into a configstring //FIREBLADE - if (teamplay->value) - AssignSkin(ent, s); - else + if (teamplay->value) + AssignSkin(ent, s); + else //FIREBLADE - gi.configstring (CS_PLAYERSKINS+playernum, va("%s\\%s", ent->client->pers.netname, s) ); + gi.configstring (CS_PLAYERSKINS+playernum, va("%s\\%s", ent->client->pers.netname, s) ); /* Not used in Action. - // fov - if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) - { - ent->client->ps.fov = 90; - } - else - { - ent->client->ps.fov = atoi(Info_ValueForKey(userinfo, "fov")); - if (ent->client->ps.fov < 1) - ent->client->ps.fov = 90; - else if (ent->client->ps.fov > 160) - ent->client->ps.fov = 160; - } + // fov + if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) + { + ent->client->ps.fov = 90; + } + else + { + ent->client->ps.fov = atoi(Info_ValueForKey(userinfo, "fov")); + if (ent->client->ps.fov < 1) + ent->client->ps.fov = 90; + else if (ent->client->ps.fov > 160) + ent->client->ps.fov = 160; + } */ - // handedness - s = Info_ValueForKey (userinfo, "hand"); - if (strlen(s)) - { - ent->client->pers.hand = atoi(s); - } + ent->client->pers.firing_style = ACTION_FIRING_CENTER; + // handedness + s = Info_ValueForKey (userinfo, "hand"); + if (strlen(s)) + { + ent->client->pers.hand = atoi(s); + if (strstr(s, "classic high") != NULL) + ent->client->pers.firing_style = ACTION_FIRING_CLASSIC_HIGH; + else if (strstr(s, "classic") != NULL) + ent->client->pers.firing_style = ACTION_FIRING_CLASSIC; + } - // save off the userinfo in case we want to check something later - strncpy (ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo)-1); + // save off the userinfo in case we want to check something later + strncpy (ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo)-1); - // zucc vwep - ShowGun(ent); + // zucc vwep + ShowGun(ent); } @@ -2323,62 +2327,62 @@ loadgames will. */ qboolean ClientConnect (edict_t *ent, char *userinfo) { - char *value, *ipaddr; - char ipaddr_buf[1000]; + char *value, *ipaddr; + char ipaddr_buf[1000]; - // check to see if they are on the banned IP list - ipaddr = Info_ValueForKey (userinfo, "ip"); + // check to see if they are on the banned IP list + ipaddr = Info_ValueForKey (userinfo, "ip"); //FIREBLADE - strcpy(ipaddr_buf, ipaddr); + strcpy(ipaddr_buf, ipaddr); //FIREBLADE // FROM 3.20 -FB - if (SV_FilterPacket(ipaddr)) { - Info_SetValueForKey(userinfo, "rejmsg", "Banned."); - return false; - } + if (SV_FilterPacket(ipaddr)) { + Info_SetValueForKey(userinfo, "rejmsg", "Banned."); + return false; + } - // check for a password - value = Info_ValueForKey (userinfo, "password"); - if (*password->string && strcmp(password->string, "none") && - strcmp(password->string, value)) { - Info_SetValueForKey(userinfo, "rejmsg", "Password required or incorrect."); - return false; - } + // check for a password + value = Info_ValueForKey (userinfo, "password"); + if (*password->string && strcmp(password->string, "none") && + strcmp(password->string, value)) { + Info_SetValueForKey(userinfo, "rejmsg", "Password required or incorrect."); + return false; + } // ^^^ - // they can connect - ent->client = game.clients + (ent - g_edicts - 1); + // they can connect + ent->client = game.clients + (ent - g_edicts - 1); //FIREBLADE // We're not going to attempt to support reconnection... - if (ent->inuse == true) - { - ClientDisconnect(ent); - ent->inuse = false; - } + if (ent->inuse == true) + { + ClientDisconnect(ent); + ent->inuse = false; + } //FIREBLADE - // if there is already a body waiting for us (a loadgame), just - // take it, otherwise spawn one from scratch - if (ent->inuse == false) - { - // clear the respawning variables - InitClientResp (ent->client); - if (!game.autosaved || !ent->client->pers.weapon) - InitClientPersistant (ent->client); - } + // if there is already a body waiting for us (a loadgame), just + // take it, otherwise spawn one from scratch + if (ent->inuse == false) + { + // clear the respawning variables + InitClientResp (ent->client); + if (!game.autosaved || !ent->client->pers.weapon) + InitClientPersistant (ent->client); + } - ClientUserinfoChanged (ent, userinfo); + ClientUserinfoChanged (ent, userinfo); - if (game.maxclients > 1) - gi.dprintf ("%s@%s connected\n",ent->client->pers.netname, ipaddr_buf); + if (game.maxclients > 1) + gi.dprintf ("%s@%s connected\n",ent->client->pers.netname, ipaddr_buf); // FROM 3.20 -FB - ent->svflags = 0; + ent->svflags = 0; // ^^^ - ent->client->pers.connected = true; - return true; + ent->client->pers.connected = true; + return true; } /* @@ -2391,60 +2395,60 @@ Will not be called between levels. */ void ClientDisconnect (edict_t *ent) { - int playernum, i; - edict_t *etemp; + int playernum, i; + edict_t *etemp; - if (!ent->client) - return; + if (!ent->client) + return; - // drop items if they are alive/not observer - if ( ent->solid != SOLID_NOT ) - TossItemsOnDeath(ent); - - // zucc free the lasersight if applicable - if (ent->lasersight) - SP_LaserSight(ent, NULL); + // drop items if they are alive/not observer + if ( ent->solid != SOLID_NOT ) + TossItemsOnDeath(ent); + + // zucc free the lasersight if applicable + if (ent->lasersight) + SP_LaserSight(ent, NULL); //FIREBLADE - if (teamplay->value && ent->solid == SOLID_TRIGGER) - RemoveFromTransparentList(ent); + if (teamplay->value && ent->solid == SOLID_TRIGGER) + RemoveFromTransparentList(ent); //FIREBLADE - ent->lasersight = NULL; + ent->lasersight = NULL; - gi.bprintf (PRINT_HIGH, "%s disconnected\n", ent->client->pers.netname); + gi.bprintf (PRINT_HIGH, "%s disconnected\n", ent->client->pers.netname); - // go clear any clients that have this guy as their attacker + // go clear any clients that have this guy as their attacker - for( i=1; i<=maxclients->value; i++ ) - { - if ( (etemp=&g_edicts[i]) && etemp->inuse ) - { - if ( etemp->client->attacker == ent ) - etemp->client->attacker = NULL; - } - } - // send effect - gi.WriteByte (svc_muzzleflash); - gi.WriteShort (ent-g_edicts); - gi.WriteByte (MZ_LOGOUT); - gi.multicast (ent->s.origin, MULTICAST_PVS); + for( i=1; i<=maxclients->value; i++ ) + { + if ( (etemp=&g_edicts[i]) && etemp->inuse ) + { + if ( etemp->client->attacker == ent ) + etemp->client->attacker = NULL; + } + } + // send effect + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (ent-g_edicts); + gi.WriteByte (MZ_LOGOUT); + gi.multicast (ent->s.origin, MULTICAST_PVS); - gi.unlinkentity (ent); - ent->s.modelindex = 0; - ent->solid = SOLID_NOT; - ent->inuse = false; - ent->classname = "disconnected"; - ent->client->pers.connected = false; + gi.unlinkentity (ent); + ent->s.modelindex = 0; + ent->solid = SOLID_NOT; + ent->inuse = false; + ent->classname = "disconnected"; + ent->client->pers.connected = false; - playernum = ent-g_edicts-1; - gi.configstring (CS_PLAYERSKINS+playernum, ""); + playernum = ent-g_edicts-1; + gi.configstring (CS_PLAYERSKINS+playernum, ""); //FIREBLADE - if (teamplay->value) - { - CheckForUnevenTeams(); - } + if (teamplay->value) + { + CheckForUnevenTeams(); + } //FIREBLADE } @@ -2457,27 +2461,27 @@ edict_t *pm_passent; // pmove doesn't need to know about passent and contentmask trace_t PM_trace (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end) { - if (pm_passent->health > 0) - return gi.trace (start, mins, maxs, end, pm_passent, MASK_PLAYERSOLID); - else - return gi.trace (start, mins, maxs, end, pm_passent, MASK_DEADSOLID); + if (pm_passent->health > 0) + return gi.trace (start, mins, maxs, end, pm_passent, MASK_PLAYERSOLID); + else + return gi.trace (start, mins, maxs, end, pm_passent, MASK_DEADSOLID); } unsigned CheckBlock (void *b, int c) { - int v,i; - v = 0; - for (i=0 ; is, sizeof(pm->s)); - c2 = CheckBlock (&pm->cmd, sizeof(pm->cmd)); - Com_Printf ("sv %3i:%i %i\n", pm->cmd.impulse, c1, c2); + c1 = CheckBlock (&pm->s, sizeof(pm->s)); + c2 = CheckBlock (&pm->cmd, sizeof(pm->cmd)); + Com_Printf ("sv %3i:%i %i\n", pm->cmd.impulse, c1, c2); } /* @@ -2490,313 +2494,313 @@ usually be a couple times for each server frame. */ void ClientThink (edict_t *ent, usercmd_t *ucmd) { - gclient_t *client; - edict_t *other; - int i, j; - pmove_t pm; + gclient_t *client; + edict_t *other; + int i, j; + pmove_t pm; - level.current_entity = ent; - client = ent->client; + level.current_entity = ent; + client = ent->client; - if (level.intermissiontime) - { - client->ps.pmove.pm_type = PM_FREEZE; - // can exit intermission after five seconds - if (level.time > level.intermissiontime + 5.0 - && (ucmd->buttons & BUTTON_ANY) ) - level.exitintermission = true; - return; - } + if (level.intermissiontime) + { + client->ps.pmove.pm_type = PM_FREEZE; + // can exit intermission after five seconds + if (level.time > level.intermissiontime + 5.0 + && (ucmd->buttons & BUTTON_ANY) ) + level.exitintermission = true; + return; + } //FIREBLADE - if ((int)motd_time->value > (client->resp.motd_refreshes * 2)) - { - if (client->resp.last_motd_refresh < (level.framenum - 20)) - { - client->resp.last_motd_refresh = level.framenum; - client->resp.motd_refreshes++; - PrintMOTD(ent); - } - } + if ((int)motd_time->value > (client->resp.motd_refreshes * 2)) + { + if (client->resp.last_motd_refresh < (level.framenum - 20)) + { + client->resp.last_motd_refresh = level.framenum; + client->resp.motd_refreshes++; + PrintMOTD(ent); + } + } //FIREBLADE - pm_passent = ent; + pm_passent = ent; // FROM 3.20 -FB - if (ent->client->chase_mode) { - client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]); - client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]); - client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]); - } else { + if (ent->client->chase_mode) { + client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]); + client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]); + client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]); + } else { // ^^^ - // set up for pmove - memset (&pm, 0, sizeof(pm)); + // set up for pmove + memset (&pm, 0, sizeof(pm)); - if (ent->movetype == MOVETYPE_NOCLIP) - client->ps.pmove.pm_type = PM_SPECTATOR; - else if (ent->s.modelindex != 255) - client->ps.pmove.pm_type = PM_GIB; - else if (ent->deadflag) - client->ps.pmove.pm_type = PM_DEAD; - else - client->ps.pmove.pm_type = PM_NORMAL; - - client->ps.pmove.gravity = sv_gravity->value; - pm.s = client->ps.pmove; - - for (i=0 ; i<3 ; i++) - { - pm.s.origin[i] = ent->s.origin[i]*8; - pm.s.velocity[i] = ent->velocity[i] * 8; - } - - if (memcmp(&client->old_pmove, &pm.s, sizeof(pm.s))) - { - pm.snapinitial = true; + if (ent->movetype == MOVETYPE_NOCLIP) + client->ps.pmove.pm_type = PM_SPECTATOR; + else if (ent->s.modelindex != 255) + client->ps.pmove.pm_type = PM_GIB; + else if (ent->deadflag) + client->ps.pmove.pm_type = PM_DEAD; + else + client->ps.pmove.pm_type = PM_NORMAL; + + client->ps.pmove.gravity = sv_gravity->value; + pm.s = client->ps.pmove; + + for (i=0 ; i<3 ; i++) + { + pm.s.origin[i] = ent->s.origin[i]*8; + pm.s.velocity[i] = ent->velocity[i] * 8; + } + + if (memcmp(&client->old_pmove, &pm.s, sizeof(pm.s))) + { + pm.snapinitial = true; // gi.dprintf ("pmove changed!\n"); - } + } - pm.cmd = *ucmd; + pm.cmd = *ucmd; - pm.trace = PM_trace; // adds default parms - pm.pointcontents = gi.pointcontents; + pm.trace = PM_trace; // adds default parms + pm.pointcontents = gi.pointcontents; - // perform a pmove - gi.Pmove (&pm); + // perform a pmove + gi.Pmove (&pm); - // save results of pmove - client->ps.pmove = pm.s; - client->old_pmove = pm.s; + // save results of pmove + client->ps.pmove = pm.s; + client->old_pmove = pm.s; - // really stopping jumping with leg damage - if ( ent->client->leg_damage && ent->groundentity && pm.s.velocity[2] > 10 ) - { - pm.s.velocity[2] = 0.0; - } + // really stopping jumping with leg damage + if ( ent->client->leg_damage && ent->groundentity && pm.s.velocity[2] > 10 ) + { + pm.s.velocity[2] = 0.0; + } - for (i=0 ; i<3 ; i++) - { - ent->s.origin[i] = pm.s.origin[i]*0.125; - ent->velocity[i] = pm.s.velocity[i]*0.125; - } + for (i=0 ; i<3 ; i++) + { + ent->s.origin[i] = pm.s.origin[i]*0.125; + ent->velocity[i] = pm.s.velocity[i]*0.125; + } - // zucc stumbling associated with leg damage - if (level.framenum % 6 <= 2) - { - - //Slow down code FOO/zucc - for (i=0 ; i<3 ; i++) - { - if ( ent->client->leg_damage && ((i < 2) || (ent->velocity[2] > 0)) && (ent->groundentity && pm.groundentity) ) - ent->velocity[i] /= 4*ent->client->leghits; //FOO - } - if (level.framenum % (6*12) == 0 && ent->client->leg_damage > 1) - gi.sound (ent, CHAN_BODY, gi.soundindex(va("*pain100_1.wav")), 1, ATTN_NORM, 0); - ent->velocity[0] = (float)((int)(ent->velocity[0]*8))/8; - ent->velocity[1] = (float)((int)(ent->velocity[1]*8))/8; - ent->velocity[2] = (float)((int)(ent->velocity[2]*8))/8; - } + // zucc stumbling associated with leg damage + if (level.framenum % 6 <= 2) + { + + //Slow down code FOO/zucc + for (i=0 ; i<3 ; i++) + { + if ( ent->client->leg_damage && ((i < 2) || (ent->velocity[2] > 0)) && (ent->groundentity && pm.groundentity) ) + ent->velocity[i] /= 4*ent->client->leghits; //FOO + } + if (level.framenum % (6*12) == 0 && ent->client->leg_damage > 1) + gi.sound (ent, CHAN_BODY, gi.soundindex(va("*pain100_1.wav")), 1, ATTN_NORM, 0); + ent->velocity[0] = (float)((int)(ent->velocity[0]*8))/8; + ent->velocity[1] = (float)((int)(ent->velocity[1]*8))/8; + ent->velocity[2] = (float)((int)(ent->velocity[2]*8))/8; + } - /* - if ( ent->client->leg_damage ) - { - ent->client->leg_dam_count++; - ent->client->leg_noise++; - if ( ent->groundentity && pm.s.velocity[2] > 10 ) - { - // gi.cprintf(ent, PRINT_HIGH, "Cutting velocity\n"); - pm.s.velocity[2] = 0.0; - } - } - - if ( ent->client->leg_noise == 250 && ent->health > 0 )// && ent->groundentity && crandom() > 0.0 ) - { + /* + if ( ent->client->leg_damage ) + { + ent->client->leg_dam_count++; + ent->client->leg_noise++; + if ( ent->groundentity && pm.s.velocity[2] > 10 ) + { + // gi.cprintf(ent, PRINT_HIGH, "Cutting velocity\n"); + pm.s.velocity[2] = 0.0; + } + } + + if ( ent->client->leg_noise == 250 && ent->health > 0 )// && ent->groundentity && crandom() > 0.0 ) + { // gi.cprintf(ent, PRINT_HIGH, "Playing sound?\n"); - ent->client->leg_noise = 0; - if (IsFemale(ent)) - gi.sound(ent, CHAN_VOICE, gi.soundindex("player/female/pain100_1.wav"), 1, ATTN_IDLE, 0); - else - gi.sound(ent, CHAN_VOICE, gi.soundindex("player/male/pain100_1.wav"), 1, ATTN_IDLE, 0); - PlayerNoise(ent, ent->s.origin, PNOISE_SELF); - } - - if ( !ent->groundentity ) - { - for (i=0 ; i<3 ; i++) - { - ent->s.origin[i] = pm.s.origin[i]*0.125; - ent->velocity[i] = pm.s.velocity[i]*0.125; - } - } - else if ( ent->client->leg_dam_count < 10 ) - { - - for (i=0 ; i<3 ; i++) - { - ent->s.origin[i] = pm.s.origin[i]*0.125; - ent->velocity[i] = pm.s.velocity[i]*0.125; - } - } - else - { - for (i=0 ; i<3 ; i++) - { - ent->velocity[i] = 0;//pm.s.velocity[i]*0.125; - } - if ( ent->client->leg_dam_count > 11 ) - ent->client->leg_dam_count = 0; - } + ent->client->leg_noise = 0; + if (IsFemale(ent)) + gi.sound(ent, CHAN_VOICE, gi.soundindex("player/female/pain100_1.wav"), 1, ATTN_IDLE, 0); + else + gi.sound(ent, CHAN_VOICE, gi.soundindex("player/male/pain100_1.wav"), 1, ATTN_IDLE, 0); + PlayerNoise(ent, ent->s.origin, PNOISE_SELF); + } + + if ( !ent->groundentity ) + { + for (i=0 ; i<3 ; i++) + { + ent->s.origin[i] = pm.s.origin[i]*0.125; + ent->velocity[i] = pm.s.velocity[i]*0.125; + } + } + else if ( ent->client->leg_dam_count < 10 ) + { + + for (i=0 ; i<3 ; i++) + { + ent->s.origin[i] = pm.s.origin[i]*0.125; + ent->velocity[i] = pm.s.velocity[i]*0.125; + } + } + else + { + for (i=0 ; i<3 ; i++) + { + ent->velocity[i] = 0;//pm.s.velocity[i]*0.125; + } + if ( ent->client->leg_dam_count > 11 ) + ent->client->leg_dam_count = 0; + } */ - VectorCopy (pm.mins, ent->mins); - VectorCopy (pm.maxs, ent->maxs); - - client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]); - client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]); - client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]); + VectorCopy (pm.mins, ent->mins); + VectorCopy (pm.maxs, ent->maxs); + + client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]); + client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]); + client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]); - // don't play sounds if they have leg damage, they can't jump anyway - if (ent->groundentity && !pm.groundentity && (pm.cmd.upmove >= 10) && (pm.waterlevel == 0) - && !ent->client->leg_damage ) - { - /* don't play jumps period. - gi.sound(ent, CHAN_VOICE, gi.soundindex("*jump1.wav"), 1, ATTN_NORM, 0); - PlayerNoise(ent, ent->s.origin, PNOISE_SELF); - */ - ent->client->jumping = 1; - } + // don't play sounds if they have leg damage, they can't jump anyway + if (ent->groundentity && !pm.groundentity && (pm.cmd.upmove >= 10) && (pm.waterlevel == 0) + && !ent->client->leg_damage ) + { + /* don't play jumps period. + gi.sound(ent, CHAN_VOICE, gi.soundindex("*jump1.wav"), 1, ATTN_NORM, 0); + PlayerNoise(ent, ent->s.origin, PNOISE_SELF); + */ + ent->client->jumping = 1; + } - ent->viewheight = pm.viewheight; - ent->waterlevel = pm.waterlevel; - ent->watertype = pm.watertype; - ent->groundentity = pm.groundentity; - if (pm.groundentity) - ent->groundentity_linkcount = pm.groundentity->linkcount; + ent->viewheight = pm.viewheight; + ent->waterlevel = pm.waterlevel; + ent->watertype = pm.watertype; + ent->groundentity = pm.groundentity; + if (pm.groundentity) + ent->groundentity_linkcount = pm.groundentity->linkcount; - if (ent->deadflag) - { - client->ps.viewangles[ROLL] = 40; - client->ps.viewangles[PITCH] = -15; - client->ps.viewangles[YAW] = client->killer_yaw; - } - else - { - VectorCopy (pm.viewangles, client->v_angle); - VectorCopy (pm.viewangles, client->ps.viewangles); - } + if (ent->deadflag) + { + client->ps.viewangles[ROLL] = 40; + client->ps.viewangles[PITCH] = -15; + client->ps.viewangles[YAW] = client->killer_yaw; + } + else + { + VectorCopy (pm.viewangles, client->v_angle); + VectorCopy (pm.viewangles, client->ps.viewangles); + } - gi.linkentity (ent); + gi.linkentity (ent); - if (ent->movetype != MOVETYPE_NOCLIP) - G_TouchTriggers (ent); - - // stop manipulating doors - client->doortoggle = 0; + if (ent->movetype != MOVETYPE_NOCLIP) + G_TouchTriggers (ent); + + // stop manipulating doors + client->doortoggle = 0; - if ( ent->client->jumping && + if ( ent->client->jumping && //FIREBLADE - ent->solid != SOLID_NOT ) + ent->solid != SOLID_NOT ) //FIREBLADE - kick_attack( ent ); + kick_attack( ent ); - // touch other objects - for (i=0 ; itouch) - continue; - other->touch (other, ent, NULL, NULL); - } - } + // touch other objects + for (i=0 ; itouch) + continue; + other->touch (other, ent, NULL, NULL); + } + } - client->oldbuttons = client->buttons; - client->buttons = ucmd->buttons; - client->latched_buttons |= client->buttons & ~client->oldbuttons; + client->oldbuttons = client->buttons; + client->buttons = ucmd->buttons; + client->latched_buttons |= client->buttons & ~client->oldbuttons; - // save light level the player is standing on for - // monster sighting AI - ent->light_level = ucmd->lightlevel; + // save light level the player is standing on for + // monster sighting AI + ent->light_level = ucmd->lightlevel; - // fire weapon from final position if needed - if (client->latched_buttons & BUTTON_ATTACK) - { - if (ent->solid == SOLID_NOT && ent->deadflag != DEAD_DEAD) - { - client->latched_buttons = 0; - if (client->chase_mode) - { - if (client->chase_mode == 1) - { - client->desired_fov = 90; - client->ps.fov = 90; - client->chase_mode++; - } - else - { - client->chase_mode = 0; - client->chase_target = NULL; - client->desired_fov = 90; - client->ps.fov = 90; - client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; - } - } - else - { - client->chase_target = NULL; - GetChaseTarget(ent); - if (client->chase_target != NULL) - { - client->chase_mode = 1; - UpdateChaseCam(ent); - } - } - } - else if (!client->weapon_thunk) - { - client->weapon_thunk = true; - Think_Weapon (ent); - } - } + // fire weapon from final position if needed + if (client->latched_buttons & BUTTON_ATTACK) + { + if (ent->solid == SOLID_NOT && ent->deadflag != DEAD_DEAD) + { + client->latched_buttons = 0; + if (client->chase_mode) + { + if (client->chase_mode == 1) + { + client->desired_fov = 90; + client->ps.fov = 90; + client->chase_mode++; + } + else + { + client->chase_mode = 0; + client->chase_target = NULL; + client->desired_fov = 90; + client->ps.fov = 90; + client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; + } + } + else + { + client->chase_target = NULL; + GetChaseTarget(ent); + if (client->chase_target != NULL) + { + client->chase_mode = 1; + UpdateChaseCam(ent); + } + } + } + else if (!client->weapon_thunk) + { + client->weapon_thunk = true; + Think_Weapon (ent); + } + } - if (client->chase_mode) - { - if (ucmd->upmove >= 10) - { - if (!(client->ps.pmove.pm_flags & PMF_JUMP_HELD)) - { - client->ps.pmove.pm_flags |= PMF_JUMP_HELD; - if (client->chase_target) - { - ChaseNext(ent); - } - else - { - GetChaseTarget(ent); - UpdateChaseCam(ent); - } - } - } - else - client->ps.pmove.pm_flags &= ~PMF_JUMP_HELD; + if (client->chase_mode) + { + if (ucmd->upmove >= 10) + { + if (!(client->ps.pmove.pm_flags & PMF_JUMP_HELD)) + { + client->ps.pmove.pm_flags |= PMF_JUMP_HELD; + if (client->chase_target) + { + ChaseNext(ent); + } + else + { + GetChaseTarget(ent); + UpdateChaseCam(ent); + } + } + } + else + client->ps.pmove.pm_flags &= ~PMF_JUMP_HELD; //FIREBLADE - ChaseTargetGone(ent); // run a check...result not important. + ChaseTargetGone(ent); // run a check...result not important. //FIREBLADE - } + } // FROM 3.20 -FB - // update chase cam if being followed - for (i = 1; i <= maxclients->value; i++) { - other = g_edicts + i; - if (other->inuse && other->client->chase_mode && other->client->chase_target == ent) - UpdateChaseCam(other); - } + // update chase cam if being followed + for (i = 1; i <= maxclients->value; i++) { + other = g_edicts + i; + if (other->inuse && other->client->chase_mode && other->client->chase_target == ent) + UpdateChaseCam(other); + } // ^^^ } @@ -2811,131 +2815,131 @@ any other entities in the world. */ void ClientBeginServerFrame (edict_t *ent) { - gclient_t *client; - int buttonMask; + gclient_t *client; + int buttonMask; - if (level.intermissiontime) - return; + if (level.intermissiontime) + return; - client = ent->client; + client = ent->client; //FIREBLADE - if (deathmatch->value && !teamplay->value && - ((ent->solid == SOLID_NOT && ent->deadflag != DEAD_DEAD) != ent->client->pers.spectator)) - { - if (ent->solid != SOLID_NOT || ent->deadflag == DEAD_DEAD) - { - if (ent->deadflag != DEAD_DEAD) - { - ent->flags &= ~FL_GODMODE; - ent->health = 0; - meansOfDeath = MOD_SUICIDE; - player_die (ent, ent, ent, 100000, vec3_origin); - // don't even bother waiting for death frames - ent->deadflag = DEAD_DEAD; - - // This will make ClientBeginServerFrame crank us into observer mode - // as soon as our death frames are done... -FB - ent->solid = SOLID_NOT; - // Also set this so we can have a way to know we've already done this... - ent->movetype = MOVETYPE_NOCLIP; + if (deathmatch->value && !teamplay->value && + ((ent->solid == SOLID_NOT && ent->deadflag != DEAD_DEAD) != ent->client->pers.spectator)) + { + if (ent->solid != SOLID_NOT || ent->deadflag == DEAD_DEAD) + { + if (ent->deadflag != DEAD_DEAD) + { + ent->flags &= ~FL_GODMODE; + ent->health = 0; + meansOfDeath = MOD_SUICIDE; + player_die (ent, ent, ent, 100000, vec3_origin); + // don't even bother waiting for death frames + ent->deadflag = DEAD_DEAD; + + // This will make ClientBeginServerFrame crank us into observer mode + // as soon as our death frames are done... -FB + ent->solid = SOLID_NOT; + // Also set this so we can have a way to know we've already done this... + ent->movetype = MOVETYPE_NOCLIP; - gi.linkentity(ent); + gi.linkentity(ent); - gi.bprintf(PRINT_HIGH, "%s became a spectator\n", ent->client->pers.netname); - } - else // immediately become observer... - { - if (ent->movetype != MOVETYPE_NOCLIP) // have we already done this? see above... - { - CopyToBodyQue(ent); - ent->solid = SOLID_NOT; - ent->svflags |= SVF_NOCLIENT; - ent->movetype = MOVETYPE_NOCLIP; - ent->client->pers.health = 100; - ent->health = 100; - ent->deadflag = DEAD_NO; - gi.linkentity(ent); - gi.bprintf(PRINT_HIGH, "%s became a spectator\n", ent->client->pers.netname); - } - } - } - else - { - ent->client->chase_mode = 0; - ent->client->chase_target = NULL; - ent->client->desired_fov = 90; - ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; - ent->solid = SOLID_BBOX; - gi.linkentity(ent); - gi.bprintf(PRINT_HIGH, "%s rejoined the game\n", ent->client->pers.netname); - respawn(ent); - } - } + gi.bprintf(PRINT_HIGH, "%s became a spectator\n", ent->client->pers.netname); + } + else // immediately become observer... + { + if (ent->movetype != MOVETYPE_NOCLIP) // have we already done this? see above... + { + CopyToBodyQue(ent); + ent->solid = SOLID_NOT; + ent->svflags |= SVF_NOCLIENT; + ent->movetype = MOVETYPE_NOCLIP; + ent->client->pers.health = 100; + ent->health = 100; + ent->deadflag = DEAD_NO; + gi.linkentity(ent); + gi.bprintf(PRINT_HIGH, "%s became a spectator\n", ent->client->pers.netname); + } + } + } + else + { + ent->client->chase_mode = 0; + ent->client->chase_target = NULL; + ent->client->desired_fov = 90; + ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; + ent->solid = SOLID_BBOX; + gi.linkentity(ent); + gi.bprintf(PRINT_HIGH, "%s rejoined the game\n", ent->client->pers.netname); + respawn(ent); + } + } //FIREBLADE - // run weapon animations if it hasn't been done by a ucmd_t - if (!client->weapon_thunk) - Think_Weapon (ent); - else - client->weapon_thunk = false; + // run weapon animations if it hasn't been done by a ucmd_t + if (!client->weapon_thunk) + Think_Weapon (ent); + else + client->weapon_thunk = false; - if (ent->deadflag) - { - // wait for any button just going down - if (level.time > client->respawn_time) - { + if (ent->deadflag) + { + // wait for any button just going down + if (level.time > client->respawn_time) + { //FIREBLADE - if (teamplay->value || - (!teamplay->value && ent->client->pers.spectator && ent->solid == SOLID_NOT && - ent->deadflag == DEAD_DEAD)) - { - CopyToBodyQue(ent); - - ent->solid = SOLID_NOT; - ent->svflags |= SVF_NOCLIENT; - ent->movetype = MOVETYPE_NOCLIP; - ent->client->pers.health = 100; - ent->health = 100; - ent->deadflag = DEAD_NO; + if (teamplay->value || + (!teamplay->value && ent->client->pers.spectator && ent->solid == SOLID_NOT && + ent->deadflag == DEAD_DEAD)) + { + CopyToBodyQue(ent); + + ent->solid = SOLID_NOT; + ent->svflags |= SVF_NOCLIENT; + ent->movetype = MOVETYPE_NOCLIP; + ent->client->pers.health = 100; + ent->health = 100; + ent->deadflag = DEAD_NO; - client->ps.pmove.delta_angles[PITCH] = ANGLE2SHORT(0 - client->resp.cmd_angles[PITCH]); - client->ps.pmove.delta_angles[YAW] = ANGLE2SHORT(client->killer_yaw - client->resp.cmd_angles[YAW]); - client->ps.pmove.delta_angles[ROLL] = ANGLE2SHORT(0 - client->resp.cmd_angles[ROLL]); - ent->s.angles[PITCH] = 0; - ent->s.angles[YAW] = client->killer_yaw; - ent->s.angles[ROLL] = 0; - VectorCopy (ent->s.angles, client->ps.viewangles); - VectorCopy (ent->s.angles, client->v_angle); + client->ps.pmove.delta_angles[PITCH] = ANGLE2SHORT(0 - client->resp.cmd_angles[PITCH]); + client->ps.pmove.delta_angles[YAW] = ANGLE2SHORT(client->killer_yaw - client->resp.cmd_angles[YAW]); + client->ps.pmove.delta_angles[ROLL] = ANGLE2SHORT(0 - client->resp.cmd_angles[ROLL]); + ent->s.angles[PITCH] = 0; + ent->s.angles[YAW] = client->killer_yaw; + ent->s.angles[ROLL] = 0; + VectorCopy (ent->s.angles, client->ps.viewangles); + VectorCopy (ent->s.angles, client->v_angle); - gi.linkentity(ent); - } + gi.linkentity(ent); + } //FIREBLADE - else - { - // in deathmatch, only wait for attack button - if (deathmatch->value) - buttonMask = BUTTON_ATTACK; - else - buttonMask = -1; + else + { + // in deathmatch, only wait for attack button + if (deathmatch->value) + buttonMask = BUTTON_ATTACK; + else + buttonMask = -1; - if ( ( client->latched_buttons & buttonMask ) || - (deathmatch->value && ((int)dmflags->value & DF_FORCE_RESPAWN) ) ) - - { - respawn(ent); - client->latched_buttons = 0; - } - } - } - return; - } + if ( ( client->latched_buttons & buttonMask ) || + (deathmatch->value && ((int)dmflags->value & DF_FORCE_RESPAWN) ) ) + + { + respawn(ent); + client->latched_buttons = 0; + } + } + } + return; + } - // add player trail so monsters can follow - if (!deathmatch->value) - if (!visible (ent, PlayerTrail_LastSpot() ) ) - PlayerTrail_Add (ent->s.old_origin); + // add player trail so monsters can follow + if (!deathmatch->value) + if (!visible (ent, PlayerTrail_LastSpot() ) ) + PlayerTrail_Add (ent->s.old_origin); - client->latched_buttons = 0; + client->latched_buttons = 0; } diff --git a/p_view.c b/p_view.c index 1435686..773541a 100644 --- a/p_view.c +++ b/p_view.c @@ -1221,8 +1221,15 @@ void ClientEndServerFrame (edict_t *ent) // zucc - clear the open door command ent->client->doortoggle = 0; - if ( ent->client->push_timeout > 0 ) - ent->client->push_timeout--; + if ( ent->client->push_timeout > 0 ) + ent->client->push_timeout--; + else + { + ent->client->attacker = NULL; + } + + if ( ent->client->reload_attempts > 0 ) + Cmd_Reload_f(ent); // if the scoreboard is up, update it diff --git a/p_weapon.c b/p_weapon.c index 1e3a247..ac2836a 100644 --- a/p_weapon.c +++ b/p_weapon.c @@ -10,18 +10,25 @@ static byte is_silenced; void weapon_grenade_fire (edict_t *ent, qboolean held); - void P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result) { vec3_t _distance; VectorCopy (distance, _distance); -/* if (client->pers.hand == LEFT_HANDED) - _distance[1] = -1; - else if (client->pers.hand == CENTER_HANDED) - _distance[1] = 0; - */ - _distance[1] = 0; // fire at the crosshair always + + if (client->pers.firing_style == ACTION_FIRING_CLASSIC || + client->pers.firing_style == ACTION_FIRING_CLASSIC_HIGH) + { + if (client->pers.hand == LEFT_HANDED) + _distance[1] *= -1; + else if (client->pers.hand == CENTER_HANDED) + _distance[1] = 0; + } + else + { + _distance[1] = 0; // fire from center always + } + G_ProjectSource (point, _distance, forward, right, result); } @@ -32,9 +39,25 @@ void Old_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t VectorCopy (distance, _distance); if (client->pers.hand == LEFT_HANDED) - _distance[1] = -1; + _distance[1] = -1; // changed from = to *= + // Fireblade 2/28/99 + // zucc reversed, this is only used for setting up shell ejection and + // since those look good this shouldn't be changed else if (client->pers.hand == CENTER_HANDED) - _distance[1] = 0; + _distance[1] = 0; + G_ProjectSource (point, _distance, forward, right, result); +} + +// this one is the real old project source +void Knife_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result) +{ + vec3_t _distance; + + VectorCopy (distance, _distance); + if (client->pers.hand == LEFT_HANDED) + _distance[1] *= -1; // changed from = to *= + else if (client->pers.hand == CENTER_HANDED) + _distance[1] = 0; G_ProjectSource (point, _distance, forward, right, result); } @@ -44,18 +67,18 @@ void Old_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t =============== PlayerNoise -Each player can have two noise objects associated with it: -a personal noise (jumping, pain, weapon firing), and a weapon -target noise (bullet wall impacts) - -Monsters that don't directly see the player can move -to a noise in hopes of seeing the player from there. -=============== + Each player can have two noise objects associated with it: + a personal noise (jumping, pain, weapon firing), and a weapon + target noise (bullet wall impacts) + + Monsters that don't directly see the player can move + to a noise in hopes of seeing the player from there. + =============== */ void PlayerNoise(edict_t *who, vec3_t where, int type) { edict_t *noise; - + if (type == PNOISE_WEAPON) { if (who->client->silencer_shots) @@ -64,14 +87,14 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) return; } } - + if (deathmatch->value) return; - + if (who->flags & FL_NOTARGET) return; - - + + if (!who->mynoise) { noise = G_Spawn(); @@ -81,7 +104,7 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) noise->owner = who; noise->svflags = SVF_NOCLIENT; who->mynoise = noise; - + noise = G_Spawn(); noise->classname = "player_noise"; VectorSet (noise->mins, -8, -8, -8); @@ -90,7 +113,7 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) noise->svflags = SVF_NOCLIENT; who->mynoise2 = noise; } - + if (type == PNOISE_SELF || type == PNOISE_WEAPON) { noise = who->mynoise; @@ -103,7 +126,7 @@ void PlayerNoise(edict_t *who, vec3_t where, int type) level.sound2_entity = noise; level.sound2_entity_framenum = level.framenum; } - + VectorCopy (where, noise->s.origin); VectorSubtract (where, noise->maxs, noise->absmin); VectorAdd (where, noise->maxs, noise->absmax); @@ -131,29 +154,29 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) { int index, index2; gitem_t *ammo; - gitem_t *item; - + gitem_t *item; + int special = 0; - int band = 0; - + int band = 0; + index = ITEM_INDEX(ent->item); - + if ( ( ((int)(dmflags->value) & DF_WEAPONS_STAY) || coop->value) && other->client->pers.inventory[index]) { if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM) ) ) return false; // leave the weapon for others to pickup } - - // find out if they have a bandolier - item = FindItem(BAND_NAME); - if ( other->client->pers.inventory[ITEM_INDEX(item)] ) - band = 1; - else - band = 0; - - + // find out if they have a bandolier + item = FindItem(BAND_NAME); + if ( other->client->pers.inventory[ITEM_INDEX(item)] ) + band = 1; + else + band = 0; + + + // zucc special cases for picking up weapons // the mk23 should never be dropped, probably @@ -173,17 +196,17 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) } else if ( stricmp(ent->item->pickup_name, MP5_NAME) == 0 ) { - if ( other->client->unique_weapon_total < unique_weapons->value + band ) - { - other->client->pers.inventory[index]++; - other->client->unique_weapon_total++; - if ( !(ent->spawnflags & DROPPED_ITEM) ) - other->client->mp5_rds = other->client->mp5_max; - special = 1; - gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); - } - else - return false; // we can't get it + if ( other->client->unique_weapon_total < unique_weapons->value + band ) + { + other->client->pers.inventory[index]++; + other->client->unique_weapon_total++; + if ( !(ent->spawnflags & DROPPED_ITEM) ) + other->client->mp5_rds = other->client->mp5_max; + special = 1; + gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); + } + else + return false; // we can't get it } else if ( stricmp(ent->item->pickup_name, M4_NAME) == 0 ) { @@ -194,7 +217,7 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) if ( !(ent->spawnflags & DROPPED_ITEM) ) other->client->m4_rds = other->client->m4_max; special = 1; - gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); + gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); } else return false; // we can't get it @@ -207,25 +230,25 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) other->client->pers.inventory[index]++; other->client->unique_weapon_total++; if ( !(ent->spawnflags & DROPPED_ITEM) ) - { - // any weapon that doesn't completely fill up each reload can - //end up in a state where it has a full weapon and pending reload(s) - if ( other->client->weaponstate == WEAPON_RELOADING ) - { - if ( other->client->fast_reload ) - { - other->client->shot_rds = other->client->shot_max - 2; - } - else - other->client->shot_rds = other->client->shot_max - 1; - } - else - { - other->client->shot_rds = other->client->shot_max; - } - } + { + // any weapon that doesn't completely fill up each reload can + //end up in a state where it has a full weapon and pending reload(s) + if ( other->client->weaponstate == WEAPON_RELOADING ) + { + if ( other->client->fast_reload ) + { + other->client->shot_rds = other->client->shot_max - 2; + } + else + other->client->shot_rds = other->client->shot_max - 1; + } + else + { + other->client->shot_rds = other->client->shot_max; + } + } special = 1; - gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); + gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); } else return false; // we can't get it @@ -233,26 +256,26 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) } else if ( stricmp(ent->item->pickup_name, HC_NAME) == 0 ) { - if ( other->client->unique_weapon_total < unique_weapons->value + band ) + if ( other->client->unique_weapon_total < unique_weapons->value + band ) + { + other->client->pers.inventory[index]++; + other->client->unique_weapon_total++; + if ( !(ent->spawnflags & DROPPED_ITEM) ) { - other->client->pers.inventory[index]++; - other->client->unique_weapon_total++; - if ( !(ent->spawnflags & DROPPED_ITEM) ) - { - other->client->cannon_rds = other->client->cannon_max; - index2 = ITEM_INDEX(FindItem(ent->item->ammo)); - if ( other->client->pers.inventory[index2] + 5 > other->client->pers.max_shells ) - other->client->pers.inventory[index2] = other->client->pers.max_shells; - else - other->client->pers.inventory[index2] += 5; - - } - gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); - special = 1; + other->client->cannon_rds = other->client->cannon_max; + index2 = ITEM_INDEX(FindItem(ent->item->ammo)); + if ( other->client->pers.inventory[index2] + 5 > other->client->pers.max_shells ) + other->client->pers.inventory[index2] = other->client->pers.max_shells; + else + other->client->pers.inventory[index2] += 5; + } - else - return false; // we can't get it - + gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); + special = 1; + } + else + return false; // we can't get it + } else if ( stricmp(ent->item->pickup_name, SNIPER_NAME) == 0 ) { @@ -261,23 +284,23 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) other->client->pers.inventory[index]++; other->client->unique_weapon_total++; if ( !(ent->spawnflags & DROPPED_ITEM) ) - { - if ( other->client->weaponstate == WEAPON_RELOADING ) - { - if ( other->client->fast_reload ) - { - other->client->sniper_rds = other->client->sniper_max - 2; - } - else - other->client->sniper_rds = other->client->sniper_max - 1; - } - else - { - other->client->sniper_rds = other->client->sniper_max; - } - } + { + if ( other->client->weaponstate == WEAPON_RELOADING ) + { + if ( other->client->fast_reload ) + { + other->client->sniper_rds = other->client->sniper_max - 2; + } + else + other->client->sniper_rds = other->client->sniper_max - 1; + } + else + { + other->client->sniper_rds = other->client->sniper_max; + } + } special = 1; - gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); + gi.cprintf(other, PRINT_HIGH, "%s - Unique Weapon\n", ent->item->pickup_name); } else return false; // we can't get it @@ -321,7 +344,7 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) if ( other->client->pers.inventory[index] < other->client->grenade_max ) { other->client->pers.inventory[index]++; - if (! (ent->spawnflags & DROPPED_PLAYER_ITEM) ) + if (! (ent->spawnflags & DROPPED_PLAYER_ITEM) && !(ent->spawnflags & DROPPED_ITEM) ) { if (deathmatch->value) { @@ -333,7 +356,7 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) if (coop->value) ent->flags |= FL_RESPAWN; } - + return true; } else @@ -371,20 +394,20 @@ qboolean Pickup_Weapon (edict_t *ent, edict_t *other) } } } -/* zucc - don't want auto switching + /* zucc - don't want auto switching if (other->client->pers.weapon != ent->item && - (other->client->pers.inventory[index] == 1) && - ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) ) - other->client->newweapon = ent->item; -*/ + (other->client->pers.inventory[index] == 1) && + ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) ) + other->client->newweapon = ent->item; + */ if ( !(ent->spawnflags & DROPPED_ITEM) && !(ent->spawnflags & DROPPED_PLAYER_ITEM) && (SPEC_WEAPON_RESPAWN) ) { SetSpecWeapHolder( ent ); } - - + + return true; } @@ -665,8 +688,8 @@ void Use_Weapon (edict_t *ent, gitem_t *item) //gitem_t *ammo_item; - if(ent->client->weaponstate == WEAPON_BANDAGING || ent->client->bandaging == 1 ) - return; +// if(ent->client->weaponstate == WEAPON_BANDAGING || ent->client->bandaging == 1 ) + // return; @@ -841,10 +864,10 @@ void Drop_Weapon (edict_t *ent, gitem_t *item) gi.cprintf(ent, PRINT_HIGH, "Can't drop the %s.\n", MK23_NAME); return; } - else if ( stricmp(item->pickup_name, MP5_NAME) == 0 && (ent->client->pers.inventory[index] == 1)) + else if ( stricmp(item->pickup_name, MP5_NAME) == 0 ) { - if ( ent->client->pers.weapon == item ) + if ( ent->client->pers.weapon == item && (ent->client->pers.inventory[index] == 1) ) { replacement = FindItem (MK23_NAME); // back to the pistol then ent->client->newweapon = replacement; @@ -858,11 +881,11 @@ void Drop_Weapon (edict_t *ent, gitem_t *item) temp->think = temp_think_specweap; ent->client->pers.inventory[index]--; } - else if ( stricmp(item->pickup_name, M4_NAME) == 0 && (ent->client->pers.inventory[index] == 1)) + else if ( stricmp(item->pickup_name, M4_NAME) == 0 ) { - if ( ent->client->pers.weapon == item ) + if ( ent->client->pers.weapon == item && (ent->client->pers.inventory[index] == 1) ) { replacement = FindItem (MK23_NAME); // back to the pistol then ent->client->newweapon = replacement; @@ -876,10 +899,10 @@ void Drop_Weapon (edict_t *ent, gitem_t *item) temp->think = temp_think_specweap; ent->client->pers.inventory[index]--; } - else if ( stricmp(item->pickup_name, M3_NAME) == 0 && (ent->client->pers.inventory[index] == 1)) + else if ( stricmp(item->pickup_name, M3_NAME) == 0 ) { - if ( ent->client->pers.weapon == item ) + if ( ent->client->pers.weapon == item && (ent->client->pers.inventory[index] == 1) ) { replacement = FindItem (MK23_NAME); // back to the pistol then ent->client->newweapon = replacement; @@ -892,9 +915,9 @@ void Drop_Weapon (edict_t *ent, gitem_t *item) temp->think = temp_think_specweap; ent->client->pers.inventory[index]--; } - else if ( stricmp(item->pickup_name, HC_NAME) == 0 && (ent->client->pers.inventory[index] == 1)) + else if ( stricmp(item->pickup_name, HC_NAME) == 0 ) { - if ( ent->client->pers.weapon == item ) + if ( ent->client->pers.weapon == item && (ent->client->pers.inventory[index] == 1) ) { replacement = FindItem (MK23_NAME); // back to the pistol then ent->client->newweapon = replacement; @@ -959,7 +982,22 @@ void Drop_Weapon (edict_t *ent, gitem_t *item) { if ( (ent->client->pers.weapon == item ) && (ent->client->pers.inventory[index] == 1) ) { - replacement = FindItem (MK23_NAME); // back to the pistol then + if ( (ent->client->ps.gunframe >= GRENADE_IDLE_FIRST) && (ent->client->ps.gunframe <= GRENADE_IDLE_LAST) + || ( ent->client->ps.gunframe >= GRENADE_THROW_FIRST && ent->client->ps.gunframe <= GRENADE_THROW_LAST) ) + { + ent->client->ps.gunframe = 0; + fire_grenade2 (ent, ent->s.origin, tv(0,0,0), GRENADE_DAMRAD, 0, 2, GRENADE_DAMRAD*2, false); + item = FindItem(GRENADE_NAME); + ent->client->pers.inventory[ITEM_INDEX(item)]--; + ent->client->newweapon = FindItem(MK23_NAME); + ent->client->weaponstate = WEAPON_DROPPING; + ent->client->ps.gunframe = 0; + return; + + } + + + replacement = FindItem (MK23_NAME); // back to the pistol then ent->client->newweapon = replacement; ent->client->weaponstate = WEAPON_DROPPING; ent->client->ps.gunframe = 0; @@ -1018,8 +1056,9 @@ void DropSpecialWeapon ( edict_t* ent ) void DropExtraSpecial( edict_t* ent ) { gitem_t *item; - - if ( (ent->client->pers.weapon == FindItem(MP5_NAME)) + + + if ( (ent->client->pers.weapon == FindItem(MP5_NAME)) || (ent->client->pers.weapon == FindItem(M4_NAME)) || (ent->client->pers.weapon == FindItem(M3_NAME)) || (ent->client->pers.weapon == FindItem(HC_NAME)) @@ -1362,26 +1401,42 @@ void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, } } - + if( ent->client->weaponstate == WEAPON_END_MAG) { - if(ent->client->ps.gunframe < FRAME_LASTRD_LAST) - ent->client->ps.gunframe++; - else - ent->client->ps.gunframe = FRAME_LASTRD_LAST; - // see if our weapon has ammo (from something other than reloading) - if ( (( ent->client->curr_weap == MK23_NUM ) && ( ent->client->mk23_rds > 0 )) - || (( ent->client->curr_weap == MP5_NUM ) && ( ent->client->mp5_rds > 0 )) - || (( ent->client->curr_weap == M4_NUM ) && ( ent->client->m4_rds > 0 )) - || (( ent->client->curr_weap == M3_NUM ) && ( ent->client->shot_rds > 0 )) - || (( ent->client->curr_weap == HC_NUM ) && ( ent->client->cannon_rds > 0 )) - || (( ent->client->curr_weap == SNIPER_NUM ) && ( ent->client->sniper_rds > 0 )) - || (( ent->client->curr_weap == DUAL_NUM ) && ( ent->client->dual_rds > 0 )) ) - { - ent->client->weaponstate = WEAPON_READY; - ent->client->ps.gunframe = FRAME_IDLE_FIRST; - } - + if(ent->client->ps.gunframe < FRAME_LASTRD_LAST) + ent->client->ps.gunframe++; + else + ent->client->ps.gunframe = FRAME_LASTRD_LAST; + // see if our weapon has ammo (from something other than reloading) + if ( (( ent->client->curr_weap == MK23_NUM ) && ( ent->client->mk23_rds > 0 )) + || (( ent->client->curr_weap == MP5_NUM ) && ( ent->client->mp5_rds > 0 )) + || (( ent->client->curr_weap == M4_NUM ) && ( ent->client->m4_rds > 0 )) + || (( ent->client->curr_weap == M3_NUM ) && ( ent->client->shot_rds > 0 )) + || (( ent->client->curr_weap == HC_NUM ) && ( ent->client->cannon_rds > 0 )) + || (( ent->client->curr_weap == SNIPER_NUM ) && ( ent->client->sniper_rds > 0 )) + || (( ent->client->curr_weap == DUAL_NUM ) && ( ent->client->dual_rds > 0 )) ) + { + ent->client->weaponstate = WEAPON_READY; + ent->client->ps.gunframe = FRAME_IDLE_FIRST; + } + if ( ((ent->client->latched_buttons|ent->client->buttons) & BUTTON_ATTACK) + //FIREBLADE + && (ent->solid != SOLID_NOT || ent->deadflag == DEAD_DEAD) && !lights_camera_action) + //FIREBLADE + { + ent->client->latched_buttons &= ~BUTTON_ATTACK; + { + if (level.time >= ent->pain_debounce_time) + { + gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/noammo.wav"), 1, ATTN_NORM, 0); + ent->pain_debounce_time = level.time + 1; + } + + + } + + } } if (ent->client->weaponstate == WEAPON_DROPPING) @@ -1440,15 +1495,27 @@ void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, switch( ent->client->curr_weap ) { case MK23_NUM: - { - if (ent->client->dual_rds >= ent->client->mk23_max ) - ent->client->mk23_rds = ent->client->mk23_max; - else - ent->client->mk23_rds = ent->client->dual_rds; - if(ent->client->ps.gunframe == 3) // 3 - gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23slide.wav"), 1, ATTN_NORM, 0); - ent->client->fired = 0; //reset any firing delays - break; + { + if (ent->client->dual_rds >= ent->client->mk23_max ) + ent->client->mk23_rds = ent->client->mk23_max; + else + ent->client->mk23_rds = ent->client->dual_rds; + if(ent->client->ps.gunframe == 3) // 3 + { + if ( ent->client->mk23_rds > 0 ) + { + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23slide.wav"), 1, ATTN_NORM, 0); + } + else + { + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/noammo.wav"), 1, ATTN_NORM, 0); + //mk23slap + ent->client->ps.gunframe = 62; + ent->client->weaponstate = WEAPON_END_MAG; + } + } + ent->client->fired = 0; //reset any firing delays + break; } case MP5_NUM: { @@ -1489,9 +1556,25 @@ void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, } case DUAL_NUM: { - ent->client->fired = 0; //reset any firing delays - ent->client->burst = 0; - break; + if ( ent->client->dual_rds <= 0 && ent->client->ps.gunframe == 3) + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/noammo.wav"), 1, ATTN_NORM, 0); + if ( ent->client->dual_rds <= 0 && ent->client->ps.gunframe == 4) + { + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/noammo.wav"), 1, ATTN_NORM, 0); + ent->client->ps.gunframe = 68; + ent->client->weaponstate = WEAPON_END_MAG; + ent->client->resp.sniper_mode = 0; + + ent->client->desired_fov = 90; + ent->client->ps.fov = 90; + ent->client->fired = 0; //reset any firing delays + ent->client->burst = 0; + + return; + } + ent->client->fired = 0; //reset any firing delays + ent->client->burst = 0; + break; } default: @@ -2814,8 +2897,18 @@ void Pistol_Fire(edict_t *ent) int damage = 90; int kick = 150; vec3_t offset; - int spread = MK23_SPREAD; - + int spread = MK23_SPREAD; + int height; + + + + + if (ent->client->pers.firing_style == ACTION_FIRING_CLASSIC) + { + height = 8; + } + else + height = 0; //If the user isn't pressing the attack button, advance the frame and go away.... if (!(ent->client->buttons & BUTTON_ATTACK)) @@ -2851,7 +2944,7 @@ void Pistol_Fire(edict_t *ent) // get start / end positions VectorAdd (ent->client->v_angle, ent->client->kick_angles, angles); AngleVectors (angles, forward, right, NULL); - VectorSet(offset, 0, 8, ent->viewheight-0); + VectorSet(offset, 0, 8, ent->viewheight-height); P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); if (!sv_shelloff->value) { @@ -2867,7 +2960,7 @@ void Pistol_Fire(edict_t *ent) // gi.cprintf(ent, PRINT_HIGH, "Spread is %d\n", spread); -/* if ((ent->client->mk23_rds == 1)) + if ((ent->client->mk23_rds == 1)) { //Hard coded for reload only. ent->client->ps.gunframe=62; @@ -2877,7 +2970,7 @@ void Pistol_Fire(edict_t *ent) ent->client->dual_rds--; } else - */ + { //If no reload, fire normally. fire_bullet (ent, start, forward, damage, kick, spread, spread,MOD_MK23); @@ -2927,7 +3020,14 @@ void MP5_Fire(edict_t *ent) int kick = 90; vec3_t offset; int spread = MP5_SPREAD; + int height; + + if (ent->client->pers.firing_style == ACTION_FIRING_CLASSIC) + height = 8; + else + height = 0; + //If the user isn't pressing the attack button, advance the frame and go away.... if (!(ent->client->buttons & BUTTON_ATTACK) && !(ent->client->burst) ) { @@ -2989,7 +3089,7 @@ void MP5_Fire(edict_t *ent) // get start / end positions VectorAdd (ent->client->v_angle, ent->client->kick_angles, angles); AngleVectors (angles, forward, right, NULL); - VectorSet(offset, 0, 8, ent->viewheight); + VectorSet(offset, 0, 8, ent->viewheight-height); P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); fire_bullet (ent, start, forward, damage, kick, spread, spread,MOD_MP5); @@ -3061,6 +3161,12 @@ void M4_Fire(edict_t *ent) int kick = 90; vec3_t offset; int spread = M4_SPREAD; + int height; + + if (ent->client->pers.firing_style == ACTION_FIRING_CLASSIC) + height = 8; + else + height = 0; //If the user isn't pressing the attack button, advance the frame and go away.... if (!(ent->client->buttons & BUTTON_ATTACK) && !(ent->client->burst) ) @@ -3139,7 +3245,7 @@ void M4_Fire(edict_t *ent) // get start / end positions VectorAdd (ent->client->v_angle, ent->client->kick_angles, angles); AngleVectors (angles, forward, right, NULL); - VectorSet(offset, 0, 8, ent->viewheight-0); + VectorSet(offset, 0, 8, ent->viewheight-height); P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); fire_bullet_sparks (ent, start, forward, damage, kick, spread, spread,MOD_M4); @@ -3208,7 +3314,13 @@ void M3_Fire (edict_t *ent) vec3_t offset; int damage = 17; //actionquake is 15 standard int kick = 20; + int height; + if (ent->client->pers.firing_style == ACTION_FIRING_CLASSIC) + height = 8; + else + height = 0; + if (ent->client->ps.gunframe == 9) { ent->client->ps.gunframe++; @@ -3220,7 +3332,7 @@ void M3_Fire (edict_t *ent) VectorScale (forward, -2, ent->client->kick_origin); ent->client->kick_angles[0] = -2; - VectorSet(offset, 0, 8, ent->viewheight-8); + VectorSet(offset, 0, 8, ent->viewheight-height); P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); /* if (is_quad) @@ -3278,13 +3390,19 @@ void HC_Fire (edict_t *ent) vec3_t v; int damage = 20; int kick = 40; + int height; + if (ent->client->pers.firing_style == ACTION_FIRING_CLASSIC) + height = 8; + else + height = 0; + AngleVectors (ent->client->v_angle, forward, right, NULL); VectorScale (forward, -2, ent->client->kick_origin); ent->client->kick_angles[0] = -2; - VectorSet(offset, 0, 8, ent->viewheight-8); + VectorSet(offset, 0, 8, ent->viewheight-height); P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); /*if (is_quad) @@ -3337,22 +3455,24 @@ void Sniper_Fire(edict_t *ent) int damage = 250; int kick = 200; vec3_t offset; - int spread = SNIPER_SPREAD; - + int spread = SNIPER_SPREAD; + + + if ( ent->client->ps.gunframe == 13 ) { - gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/ssgbolt.wav"), 1, ATTN_NORM, 0); - ent->client->ps.gunframe++; - - - AngleVectors (ent->client->v_angle, forward, right, NULL); - VectorSet(offset, 0, 0, ent->viewheight-0); - - P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); - - EjectShell(ent, start, 0); - return; + gi.sound(ent, CHAN_AUTO, gi.soundindex("weapons/ssgbolt.wav"), 1, ATTN_NORM, 0); + ent->client->ps.gunframe++; + + + AngleVectors (ent->client->v_angle, forward, right, NULL); + VectorSet(offset, 0, 0, ent->viewheight-0); + + P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); + + EjectShell(ent, start, 0); + return; } if ( ent->client->ps.gunframe == 21 ) @@ -3461,128 +3581,168 @@ void Weapon_Sniper (edict_t *ent) void Dual_Fire(edict_t *ent) { - int i; - vec3_t start; - vec3_t forward, right; - vec3_t angles; - int damage = 90; - int kick = 90; - vec3_t offset; - int spread = DUAL_SPREAD; - - //If the user isn't pressing the attack button, advance the frame and go away.... - if ( ent->client->ps.gunframe == 8 ) - { - gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); - ent->client->ps.gunframe++; - return; - } + int i; + vec3_t start; + vec3_t forward, right; + vec3_t angles; + int damage = 90; + int kick = 90; + vec3_t offset; + int spread = DUAL_SPREAD; + int height; - if ( ent->client->ps.gunframe == 9 ) - { - ent->client->ps.gunframe += 2; - return; - } + if (ent->client->pers.firing_style == ACTION_FIRING_CLASSIC) + height = 8; + else + height = 0; + + + spread = AdjustSpread( ent, spread ); + + if (ent->client->dual_rds < 1) + { + ent->client->ps.gunframe = 68; + if (level.time >= ent->pain_debounce_time) + { + gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/noammo.wav"),1, ATTN_NORM, 0); + ent->pain_debounce_time = level.time + 1; + } + //NoAmmoWeaponChange (ent); + return; + } + + + + //If the user isn't pressing the attack button, advance the frame and go away.... + if ( ent->client->ps.gunframe == 8 ) + { + //gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); + ent->client->ps.gunframe++; + + VectorAdd (ent->client->v_angle, ent->client->kick_angles, angles); + AngleVectors (angles, forward, right, NULL); - /*if (!(ent->client->buttons & BUTTON_ATTACK)) - { - ent->client->ps.gunframe++; - return; - }*/ - ent->client->ps.gunframe++; - - //Oops! Out of ammo! - if (ent->client->dual_rds < 1) - { - ent->client->ps.gunframe = 12; - if (level.time >= ent->pain_debounce_time) - { - gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/noammo.wav"),1, ATTN_NORM, 0); - ent->pain_debounce_time = level.time + 1; - } - //NoAmmoWeaponChange (ent); - return; - } - - - //Calculate the kick angles - for (i=1 ; i<3 ; i++) - { - ent->client->kick_origin[i] = crandom() * 0.25; - ent->client->kick_angles[i] = crandom() * 0.5; - } - ent->client->kick_origin[0] = crandom() * 0.35; - - // get start / end positions - VectorAdd (ent->client->v_angle, ent->client->kick_angles, angles); - AngleVectors (angles, forward, right, NULL); - // first set up for left firing - VectorSet(offset, 0, -8, ent->viewheight); - P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); - - if (!sv_shelloff->value) - { - vec3_t result; - Old_ProjectSource (ent->client, ent->s.origin, offset, forward, right, result); - EjectShell(ent, result, 1); - } - - - - spread = AdjustSpread( ent, spread ); - - - //If no reload, fire normally. - fire_bullet (ent, start, forward, damage, kick, spread, spread,MOD_DUAL); - //now set it up for firing the right gun - VectorSet(offset, 0, 8, ent->viewheight); - P_ProjectSource(ent->client, ent->s.origin, offset, forward, right, start); - if ( ent->client->dual_rds > 1 ) - { - fire_bullet (ent, start, forward, damage, kick, spread, spread,MOD_DUAL); - - if (!sv_shelloff->value) - { - vec3_t result; - Old_ProjectSource (ent->client, ent->s.origin, offset, forward, right, result); - EjectShell(ent, result, 2); - } - - if ( ent->client->dual_rds > ent->client->mk23_max + 1 ) - { - ent->client->dual_rds -= 2; - } - else if ( ent->client->dual_rds > ent->client->mk23_max ) // 13 rounds left - { - ent->client->dual_rds -= 2; - ent->client->mk23_rds--; - } - else - { - ent->client->dual_rds -= 2; - ent->client->mk23_rds -= 2; - } - gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); - } - else - { - ent->client->dual_rds = 0; - ent->client->mk23_rds = 0; - gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/noammo.wav"),1, ATTN_NORM, 0); - //ent->pain_debounce_time = level.time + 1; - } - - - //gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); - //Display the yellow muzzleflash light effect - gi.WriteByte (svc_muzzleflash); - gi.WriteShort (ent-g_edicts); - //If not silenced, play a shot sound for everyone else - gi.WriteByte (MZ_MACHINEGUN | is_silenced); - gi.multicast (ent->s.origin, MULTICAST_PVS); - PlayerNoise(ent, start, PNOISE_WEAPON); - - + VectorSet(offset, 0, 8, ent->viewheight-height); + P_ProjectSource(ent->client, ent->s.origin, offset, forward, right, start); + if ( ent->client->dual_rds > 1 ) + { + + fire_bullet (ent, start, forward, damage, kick, spread, spread,MOD_DUAL); + + if (!sv_shelloff->value) + { + vec3_t result; + Old_ProjectSource (ent->client, ent->s.origin, offset, forward, right, result); + EjectShell(ent, result, 2); + } + + if ( ent->client->dual_rds > ent->client->mk23_max + 1 ) + { + ent->client->dual_rds -= 2; + } + else if ( ent->client->dual_rds > ent->client->mk23_max ) // 13 rounds left + { + ent->client->dual_rds -= 2; + ent->client->mk23_rds--; + } + else + { + ent->client->dual_rds -= 2; + ent->client->mk23_rds -= 2; + } + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); + + if (ent->client->dual_rds == 0) + { + ent->client->ps.gunframe=68; + ent->client->weaponstate = WEAPON_END_MAG; + + } + + + } + else + { + ent->client->dual_rds = 0; + ent->client->mk23_rds = 0; + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/noammo.wav"),1, ATTN_NORM, 0); + //ent->pain_debounce_time = level.time + 1; + ent->client->ps.gunframe=68; + ent->client->weaponstate = WEAPON_END_MAG; + + } + return; + } + + if ( ent->client->ps.gunframe == 9 ) + { + ent->client->ps.gunframe += 2; + + return; + } + + + /*if (!(ent->client->buttons & BUTTON_ATTACK)) + { + ent->client->ps.gunframe++; + return; +}*/ + ent->client->ps.gunframe++; + + //Oops! Out of ammo! + if (ent->client->dual_rds < 1) + { + ent->client->ps.gunframe = 12; + if (level.time >= ent->pain_debounce_time) + { + gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/noammo.wav"),1, ATTN_NORM, 0); + ent->pain_debounce_time = level.time + 1; + } + //NoAmmoWeaponChange (ent); + return; + } + + + //Calculate the kick angles + for (i=1 ; i<3 ; i++) + { + ent->client->kick_origin[i] = crandom() * 0.25; + ent->client->kick_angles[i] = crandom() * 0.5; + } + ent->client->kick_origin[0] = crandom() * 0.35; + + // get start / end positions + VectorAdd (ent->client->v_angle, ent->client->kick_angles, angles); + AngleVectors (angles, forward, right, NULL); + // first set up for left firing + VectorSet(offset, 0, -20, ent->viewheight-height); + P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); + + if (!sv_shelloff->value) + { + vec3_t result; + Old_ProjectSource (ent->client, ent->s.origin, offset, forward, right, result); + EjectShell(ent, result, 1); + } + + + + //If no reload, fire normally. + fire_bullet (ent, start, forward, damage, kick, spread, spread,MOD_DUAL); + gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); + + + + //gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/mk23fire.wav"), 1, ATTN_NORM, 0); + //Display the yellow muzzleflash light effect + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (ent-g_edicts); + //If not silenced, play a shot sound for everyone else + gi.WriteByte (MZ_MACHINEGUN | is_silenced); + gi.multicast (ent->s.origin, MULTICAST_PVS); + PlayerNoise(ent, start, PNOISE_WEAPON); + + } void Weapon_Dual (edict_t *ent) @@ -3968,15 +4128,18 @@ int Knife_Fire (edict_t *ent) v[PITCH] = ent->client->v_angle[PITCH]; v[ROLL] = ent->client->v_angle[ROLL]; - + // zucc updated these to not have offsets anymore for 1.51, + // this should fix the complaints about the knife not + // doing enough damage + if ( ent->client->ps.gunframe == 6 ) { - v[YAW] = ent->client->v_angle[YAW] + 5; + v[YAW] = ent->client->v_angle[YAW];// + 5; AngleVectors (v, forward, NULL, NULL); } else if ( ent->client->ps.gunframe == 7 ) { - v[YAW] = ent->client->v_angle[YAW] + 2; + v[YAW] = ent->client->v_angle[YAW];// + 2; AngleVectors (v, forward, NULL, NULL); } else if ( ent->client->ps.gunframe == 8 ) @@ -3986,12 +4149,12 @@ int Knife_Fire (edict_t *ent) } else if ( ent->client->ps.gunframe == 9 ) { - v[YAW] = ent->client->v_angle[YAW] - 2; + v[YAW] = ent->client->v_angle[YAW];// - 2; AngleVectors (v, forward, NULL, NULL); } else if ( ent->client->ps.gunframe == 10 ) { - v[YAW] = ent->client->v_angle[YAW] -5; + v[YAW] = ent->client->v_angle[YAW]; //-5; AngleVectors (v, forward, NULL, NULL); } @@ -4044,7 +4207,7 @@ int Knife_Fire (edict_t *ent) // pretty stupid - Old_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); + Knife_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start); item = FindItem(KNIFE_NAME); ent->client->pers.inventory[ITEM_INDEX(item)]--; @@ -4157,8 +4320,8 @@ void gas_fire (edict_t *ent ) #define GRENADE_ACTIVATE_LAST 3 #define GRENADE_PULL_FIRST 72 #define GRENADE_PULL_LAST 79 -#define GRENADE_THROW_FIRST 4 -#define GRENADE_THROW_LAST 9 // throw it on frame 8? +//#define GRENADE_THROW_FIRST 4 +//#define GRENADE_THROW_LAST 9 // throw it on frame 8? #define GRENADE_PINIDLE_FIRST 10 #define GRENADE_PINIDLE_LAST 39 // moved these up in the file (actually now in g_local.h) @@ -4170,282 +4333,284 @@ void gas_fire (edict_t *ent ) void Weapon_Gas (edict_t *ent) { - gitem_t* item; - if(ent->s.modelindex != 255) // zucc vwep - return; // not on client, so VWep animations could do wacky things - -//FIREBLADE - if (ent->client->weaponstate == WEAPON_FIRING && - ((ent->solid == SOLID_NOT && ent->deadflag != DEAD_DEAD) || - lights_camera_action)) - { - ent->client->weaponstate = WEAPON_READY; - } -//FIREBLADE - - if( ent->client->weaponstate == WEAPON_RELOADING) - { - if(ent->client->ps.gunframe < GRENADE_ACTIVATE_LAST) - { - ent->client->ps.gunframe++; - } - else - { - ent->client->ps.gunframe = GRENADE_PINIDLE_FIRST; - ent->client->weaponstate = WEAPON_READY; - } - } - - if (ent->client->weaponstate == WEAPON_DROPPING) - { - if (ent->client->ps.gunframe == 0) - { - ChangeWeapon (ent); - return; - } - else - { - // zucc going to have to do this a bit different because - // of the way I roll gunframes backwards for the thrownknife position - if((ent->client->ps.gunframe) == 3) - { - ent->client->anim_priority = ANIM_REVERSE; - if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) - { - ent->s.frame = FRAME_crpain4+1; - ent->client->anim_end = FRAME_crpain1; - } - else - { - ent->s.frame = FRAME_pain304+1; - ent->client->anim_end = FRAME_pain301; - - } - } - ent->client->ps.gunframe--; - return; - } - - } - if (ent->client->weaponstate == WEAPON_ACTIVATING) - { - - if (ent->client->ps.gunframe == GRENADE_ACTIVATE_LAST ) - { - ent->client->ps.gunframe = GRENADE_PINIDLE_FIRST; - ent->client->weaponstate = WEAPON_READY; - return; - } - - if ( ent->client->ps.gunframe == GRENADE_PULL_LAST ) - { - ent->client->ps.gunframe = GRENADE_IDLE_FIRST; - ent->client->weaponstate = WEAPON_READY; - gi.cprintf(ent, PRINT_HIGH, "Pin pulled, ready for %s range throw\n", ent->client->resp.grenade_mode == 0 ? "short" : (ent->client->resp.grenade_mode == 1 ? "medium" : "long" ) ); - return; - } - - if ( ent->client->ps.gunframe == 75 ) - { - gi.sound(ent, CHAN_WEAPON, gi.soundindex("misc/grenade.wav"), 1, ATTN_NORM, 0); - } - - ent->client->resp.sniper_mode = 0; - // has to be here for dropping the sniper rifle, in the drop command didn't work... - ent->client->desired_fov = 90; - ent->client->ps.fov = 90; - - ent->client->ps.gunframe++; -// gi.cprintf(ent, PRINT_HIGH, "After increment frames = %d\n", ent->client->ps.gunframe); - return; - } - - - // bandaging case - if ( (ent->client->bandaging) - && (ent->client->weaponstate != WEAPON_FIRING) - && (ent->client->weaponstate != WEAPON_BURSTING) - && (ent->client->weaponstate != WEAPON_BUSY) - && (ent->client->weaponstate != WEAPON_BANDAGING) ) - { - ent->client->weaponstate = WEAPON_BANDAGING; - ent->client->ps.gunframe = GRENADE_ACTIVATE_LAST; - return; - } - - - if ( ent->client->weaponstate == WEAPON_BUSY ) - { - - - if ( ent->client->bandaging == 1 ) - { - if ( !(ent->client->idle_weapon) ) - { - Bandage( ent ); - } - else - (ent->client->idle_weapon)--; - return; - } - // for after bandaging delay - if ( !(ent->client->idle_weapon) && ent->client->bandage_stopped ) - { - gitem_t *item; - item = FindItem(GRENADE_NAME); - if ( ent->client->pers.inventory[ITEM_INDEX(item)] <= 0 ) - { - ent->client->newweapon = FindItem( MK23_NAME ); - ent->client->bandage_stopped = 0; - ChangeWeapon( ent ); - return; - } - - ent->client->weaponstate = WEAPON_ACTIVATING; - ent->client->ps.gunframe = 0; - ent->client->bandage_stopped = 0; - } - else if ( ent->client->bandage_stopped ) - (ent->client->idle_weapon)--; - - - } - - if ( ent->client->weaponstate == WEAPON_BANDAGING ) - { - if (ent->client->ps.gunframe == 0 ) - { - ent->client->weaponstate = WEAPON_BUSY; - ent->client->idle_weapon = BANDAGE_TIME; - return; - } - ent->client->ps.gunframe--; - return; - } - - - if ((ent->client->newweapon) && (ent->client->weaponstate != WEAPON_FIRING) - && (ent->client->weaponstate != WEAPON_BUSY ) ) - { - - // zucc - check if they have a primed grenade - - if ( ent->client->curr_weap == GRENADE_NUM - && ( ent->client->ps.gunframe >= GRENADE_IDLE_FIRST - && ent->client->ps.gunframe <= GRENADE_IDLE_LAST ) ) - { - fire_grenade2 (ent, ent->s.origin, tv(0,0,0), GRENADE_DAMRAD, 0, 2, GRENADE_DAMRAD*2, false); - item = FindItem(GRENADE_NAME); - ent->client->pers.inventory[ITEM_INDEX(item)]--; - if ( ent->client->pers.inventory[ITEM_INDEX(item)] <= 0 ) - { - ent->client->newweapon = FindItem( MK23_NAME ); - ChangeWeapon( ent ); - return; - } - - } - - - ent->client->ps.gunframe = GRENADE_ACTIVATE_LAST; - // zucc more vwep stuff - if((GRENADE_ACTIVATE_LAST) < 4) - { - ent->client->anim_priority = ANIM_REVERSE; - if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) - { - ent->s.frame = FRAME_crpain4+1; - ent->client->anim_end = FRAME_crpain1; - } - else - { - ent->s.frame = FRAME_pain304+1; - ent->client->anim_end = FRAME_pain301; - - } - } - - ent->client->weaponstate = WEAPON_DROPPING; - return; - } - - if (ent->client->weaponstate == WEAPON_READY) - { - if ( ((ent->client->latched_buttons|ent->client->buttons) & BUTTON_ATTACK) -//FIREBLADE - && (ent->solid != SOLID_NOT || ent->deadflag == DEAD_DEAD) && - !lights_camera_action) -//FIREBLADE - - { - - - if ( ent->client->ps.gunframe <= GRENADE_PINIDLE_LAST && - ent->client->ps.gunframe >= GRENADE_PINIDLE_FIRST ) - { - ent->client->ps.gunframe = GRENADE_PULL_FIRST; - ent->client->weaponstate = WEAPON_ACTIVATING; - ent->client->latched_buttons &= ~BUTTON_ATTACK; - } - else - { - if (ent->client->ps.gunframe == GRENADE_IDLE_LAST) - { - ent->client->ps.gunframe = GRENADE_IDLE_FIRST; - return; - } - ent->client->ps.gunframe++; - return; - } - } - - if ( ent->client->ps.gunframe >= GRENADE_IDLE_FIRST && - ent->client->ps.gunframe <= GRENADE_IDLE_LAST ) - { - ent->client->ps.gunframe = GRENADE_THROW_FIRST; - ent->client->anim_priority = ANIM_ATTACK; - if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) - { - ent->s.frame = FRAME_crattak1-1; - ent->client->anim_end = FRAME_crattak9; - } - else - { - ent->s.frame = FRAME_attack1-1; - ent->client->anim_end = FRAME_attack8; - } - ent->client->weaponstate = WEAPON_FIRING; - return; - - - - } - - if ( ent->client->ps.gunframe == GRENADE_PINIDLE_LAST) - { - ent->client->ps.gunframe = GRENADE_PINIDLE_FIRST; - return; - } - - ent->client->ps.gunframe++; - return; - } - if (ent->client->weaponstate == WEAPON_FIRING ) - { - - - if ( ent->client->ps.gunframe == 8 ) - { - gas_fire(ent); - return; - } - - - - ent->client->ps.gunframe++; - - if (ent->client->ps.gunframe == GRENADE_IDLE_FIRST+1 || - ent->client->ps.gunframe == GRENADE_PINIDLE_FIRST+1 ) - ent->client->weaponstate = WEAPON_READY; - } + gitem_t* item; + if(ent->s.modelindex != 255) // zucc vwep + return; // not on client, so VWep animations could do wacky things + + //FIREBLADE + if (ent->client->weaponstate == WEAPON_FIRING && + ((ent->solid == SOLID_NOT && ent->deadflag != DEAD_DEAD) || + lights_camera_action)) + { + ent->client->weaponstate = WEAPON_READY; + } + //FIREBLADE + + if( ent->client->weaponstate == WEAPON_RELOADING) + { + if(ent->client->ps.gunframe < GRENADE_ACTIVATE_LAST) + { + ent->client->ps.gunframe++; + } + else + { + ent->client->ps.gunframe = GRENADE_PINIDLE_FIRST; + ent->client->weaponstate = WEAPON_READY; + } + } + + if (ent->client->weaponstate == WEAPON_DROPPING) + { + if (ent->client->ps.gunframe == 0) + { + ChangeWeapon (ent); + return; + } + else + { + // zucc going to have to do this a bit different because + // of the way I roll gunframes backwards for the thrownknife position + if((ent->client->ps.gunframe) == 3) + { + ent->client->anim_priority = ANIM_REVERSE; + if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) + { + ent->s.frame = FRAME_crpain4+1; + ent->client->anim_end = FRAME_crpain1; + } + else + { + ent->s.frame = FRAME_pain304+1; + ent->client->anim_end = FRAME_pain301; + + } + } + ent->client->ps.gunframe--; + return; + } + + } + if (ent->client->weaponstate == WEAPON_ACTIVATING) + { + + if (ent->client->ps.gunframe == GRENADE_ACTIVATE_LAST ) + { + ent->client->ps.gunframe = GRENADE_PINIDLE_FIRST; + ent->client->weaponstate = WEAPON_READY; + return; + } + + if ( ent->client->ps.gunframe == GRENADE_PULL_LAST ) + { + ent->client->ps.gunframe = GRENADE_IDLE_FIRST; + ent->client->weaponstate = WEAPON_READY; + gi.cprintf(ent, PRINT_HIGH, "Pin pulled, ready for %s range throw\n", ent->client->resp.grenade_mode == 0 ? "short" : (ent->client->resp.grenade_mode == 1 ? "medium" : "long" ) ); + return; + } + + if ( ent->client->ps.gunframe == 75 ) + { + gi.sound(ent, CHAN_WEAPON, gi.soundindex("misc/grenade.wav"), 1, ATTN_NORM, 0); + } + + ent->client->resp.sniper_mode = 0; + // has to be here for dropping the sniper rifle, in the drop command didn't work... + ent->client->desired_fov = 90; + ent->client->ps.fov = 90; + + ent->client->ps.gunframe++; + // gi.cprintf(ent, PRINT_HIGH, "After increment frames = %d\n", ent->client->ps.gunframe); + return; + } + + + // bandaging case + if ( (ent->client->bandaging) + && (ent->client->weaponstate != WEAPON_FIRING) + && (ent->client->weaponstate != WEAPON_BURSTING) + && (ent->client->weaponstate != WEAPON_BUSY) + && (ent->client->weaponstate != WEAPON_BANDAGING) ) + { + ent->client->weaponstate = WEAPON_BANDAGING; + ent->client->ps.gunframe = GRENADE_ACTIVATE_LAST; + return; + } + + + if ( ent->client->weaponstate == WEAPON_BUSY ) + { + + + if ( ent->client->bandaging == 1 ) + { + if ( !(ent->client->idle_weapon) ) + { + Bandage( ent ); + } + else + (ent->client->idle_weapon)--; + return; + } + // for after bandaging delay + if ( !(ent->client->idle_weapon) && ent->client->bandage_stopped ) + { + gitem_t *item; + item = FindItem(GRENADE_NAME); + if ( ent->client->pers.inventory[ITEM_INDEX(item)] <= 0 ) + { + ent->client->newweapon = FindItem( MK23_NAME ); + ent->client->bandage_stopped = 0; + ChangeWeapon( ent ); + return; + } + + ent->client->weaponstate = WEAPON_ACTIVATING; + ent->client->ps.gunframe = 0; + ent->client->bandage_stopped = 0; + } + else if ( ent->client->bandage_stopped ) + (ent->client->idle_weapon)--; + + + } + + if ( ent->client->weaponstate == WEAPON_BANDAGING ) + { + if (ent->client->ps.gunframe == 0 ) + { + ent->client->weaponstate = WEAPON_BUSY; + ent->client->idle_weapon = BANDAGE_TIME; + return; + } + ent->client->ps.gunframe--; + return; + } + + + if ((ent->client->newweapon) && (ent->client->weaponstate != WEAPON_FIRING) + && (ent->client->weaponstate != WEAPON_BUSY ) ) + { + + // zucc - check if they have a primed grenade + + if ( ent->client->curr_weap == GRENADE_NUM + && ( ( ent->client->ps.gunframe >= GRENADE_IDLE_FIRST + && ent->client->ps.gunframe <= GRENADE_IDLE_LAST ) + || ( ent->client->ps.gunframe >= GRENADE_THROW_FIRST + && ent->client->ps.gunframe <= GRENADE_THROW_LAST ) ) ) + { + fire_grenade2 (ent, ent->s.origin, tv(0,0,0), GRENADE_DAMRAD, 0, 2, GRENADE_DAMRAD*2, false); + item = FindItem(GRENADE_NAME); + ent->client->pers.inventory[ITEM_INDEX(item)]--; + if ( ent->client->pers.inventory[ITEM_INDEX(item)] <= 0 ) + { + ent->client->newweapon = FindItem( MK23_NAME ); + ChangeWeapon( ent ); + return; + } + + } + + + ent->client->ps.gunframe = GRENADE_ACTIVATE_LAST; + // zucc more vwep stuff + if((GRENADE_ACTIVATE_LAST) < 4) + { + ent->client->anim_priority = ANIM_REVERSE; + if(ent->client->ps.pmove.pm_flags & PMF_DUCKED) + { + ent->s.frame = FRAME_crpain4+1; + ent->client->anim_end = FRAME_crpain1; + } + else + { + ent->s.frame = FRAME_pain304+1; + ent->client->anim_end = FRAME_pain301; + + } + } + + ent->client->weaponstate = WEAPON_DROPPING; + return; + } + + if (ent->client->weaponstate == WEAPON_READY) + { + if ( ((ent->client->latched_buttons|ent->client->buttons) & BUTTON_ATTACK) + //FIREBLADE + && (ent->solid != SOLID_NOT || ent->deadflag == DEAD_DEAD) && + !lights_camera_action) + //FIREBLADE + + { + + + if ( ent->client->ps.gunframe <= GRENADE_PINIDLE_LAST && + ent->client->ps.gunframe >= GRENADE_PINIDLE_FIRST ) + { + ent->client->ps.gunframe = GRENADE_PULL_FIRST; + ent->client->weaponstate = WEAPON_ACTIVATING; + ent->client->latched_buttons &= ~BUTTON_ATTACK; + } + else + { + if (ent->client->ps.gunframe == GRENADE_IDLE_LAST) + { + ent->client->ps.gunframe = GRENADE_IDLE_FIRST; + return; + } + ent->client->ps.gunframe++; + return; + } + } + + if ( ent->client->ps.gunframe >= GRENADE_IDLE_FIRST && + ent->client->ps.gunframe <= GRENADE_IDLE_LAST ) + { + ent->client->ps.gunframe = GRENADE_THROW_FIRST; + ent->client->anim_priority = ANIM_ATTACK; + if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) + { + ent->s.frame = FRAME_crattak1-1; + ent->client->anim_end = FRAME_crattak9; + } + else + { + ent->s.frame = FRAME_attack1-1; + ent->client->anim_end = FRAME_attack8; + } + ent->client->weaponstate = WEAPON_FIRING; + return; + + + + } + + if ( ent->client->ps.gunframe == GRENADE_PINIDLE_LAST) + { + ent->client->ps.gunframe = GRENADE_PINIDLE_FIRST; + return; + } + + ent->client->ps.gunframe++; + return; + } + if (ent->client->weaponstate == WEAPON_FIRING ) + { + + + if ( ent->client->ps.gunframe == 8 ) + { + gas_fire(ent); + return; + } + + + + ent->client->ps.gunframe++; + + if (ent->client->ps.gunframe == GRENADE_IDLE_FIRST+1 || + ent->client->ps.gunframe == GRENADE_PINIDLE_FIRST+1 ) + ent->client->weaponstate = WEAPON_READY; + } }