Bugs


(*Shadow* Commando) #1

Hi,

I found three bugs, hope someone can help me with fixing them.

  1. When you switch team, there will be a deadsign in front off you name that won’t disappear.

  2. When you’ve got level 4 light/heavy weapons you will become spectator on map switch.

  3. When you’re client 0 (private) or referee (dont know excactly which of them it is) you’re xp is set to 0 after a map switch.

I hope you can help me out.


(Jaquboss) #2

That´s in mod or in stock ET ?


(*Shadow* Commando) #3

They are in the source…
And with bug nr. 3 i believe it’s caused by the xp-save that i set on.
i used your code #define usexpstorage in bg_public.h but your xp is lost after each map
very strange


(Rain) #4

I don’t have fixes handy for you, but I do remember what caused the first two, so maybe I can save you some work:
#1 is server-side, caused by client->ps.persistant[PERS_RESPAWNS_LEFT] being dropped from -1 (no limit) to -2 (skulled in limited-life/LMS game), even if you’re not in a limited-life game.
#2 is client-side, caused by CG_LimboPanel_SendSetupMsg() being called before all of the clientinfo is set up (since the skill upgrade code in CG_NewClientInfo() sees the transition from 0 (unset) to 4 and tries to switch your weapon immediately.)

I think that, for #1, we just found where PERS_RESPAWNS_LEFT was being decremented and kept that from happening when there was no limit on the number of lives. The fix for #2 was a bit more complex: I basically made the server apply the weapon switches whenever the appropriate skill upgrades happened, and the server would then send a message to the client with its current class and weapon selections. This was done to fix a couple of other weird cases where things wouldn’t match up on the server and the client, although I can’t remember those offhand.


(Demolama) #5

fix for #1

 //derek remove respawn check to fix the skull never leaving 
if( /*score->respawnsLeft == -2 ||*/ (cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health <= GIB_HEALTH ) ) {
			CG_DrawPic( tempx, y, 18, 18, cgs.media.scoreEliminatedShader );
			offset += 18;
			tempx += 18;
			maxchars -= 2;
		} else if( cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health <= 0 ) {
			CG_DrawPic( tempx + 1, y + 1, 16, 16, cgs.media.medicIcon );
			offset += 18;
			tempx += 18;
			maxchars -= 2;			
		}
		
	}

fix for #2

	for( i = 0; i < SK_NUM_SKILLS; i++ ) {
			if( newInfo.skill[i] > cgs.clientinfo[ cg.clientNum ].skill[i] ) {
				// Gordon: slick hack so that funcs we call use teh new value now
				cgs.clientinfo[ cg.clientNum ].skill[ i ] = newInfo.skill[ i ];

				//Derek removed the CG_LimboPanel_SendSetupMsg function calls to fix the forced into spec bug

				if( newInfo.skill[i] == 4 && i == SK_HEAVY_WEAPONS ) {
					if( cgs.clientinfo[ cg.clientNum ].skill[SK_LIGHT_WEAPONS] == 4 ) {
						CG_LimboPanel_SetSelectedWeaponNumForSlot( 1, 2 );
					//	CG_LimboPanel_SendSetupMsg( qfalse );
					} else {
						CG_LimboPanel_SetSelectedWeaponNumForSlot( 1, 1 );
					//	CG_LimboPanel_SendSetupMsg( qfalse );
					}
				}

				if( newInfo.skill[i] == 4 && i == SK_LIGHT_WEAPONS ) {
					if( cgs.clientinfo[ cg.clientNum ].skill[SK_HEAVY_WEAPONS] == 4 ) {
						if( cgs.ccSelectedWeapon2 == 2 ) {
							CG_LimboPanel_SetSelectedWeaponNumForSlot( 1, 3 );
					//		CG_LimboPanel_SendSetupMsg( qfalse );
						}
					} else {
						CG_LimboPanel_SetSelectedWeaponNumForSlot( 1, 1 );
					// 	CG_LimboPanel_SendSetupMsg( qfalse );
					}					
				}

				CG_AddPMItemBig( PM_SKILL, va("Increased %s skill to level %i!", skillNames[i], newInfo.skill[i] ), cgs.media.skillPics[ i ] );

				CG_PriorityCenterPrint( va( "You have been rewarded with %s", cg_skillRewards[ i ][ newInfo.skill[i]-1 ]), SCREEN_HEIGHT - (SCREEN_HEIGHT * 0.20), SMALLCHAR_WIDTH, 99999 );
			}
		}

([RW]FRED) #6

Theses bugs appear when u active the macro USEXPSTORAGE. In fact the function ipXPStorage_t* G_FindIpData( ipXPStorageList_t *ipXPStorageList, char *from ) is bugged, and can return a dangling pointer due an oversized array index. to fix it:

original code: for( i = 0; i < MAX_IPFILTERS; i++ ) {
correct code: for( i = 0; i < MAX_XPSTORAGEITEMS; i++ ) {

MAX_IPFILTERS = 1024
MAX_XPSTORAGEITEMS = 64

typedef struct ipXPStorageList_s {
ipXPStorage_t ipFilters[MAX_XPSTORAGEITEMS];
} ipXPStorageList_t;

I think that SD team remove XP storage with this unfounded bug

Regards


(Jaquboss) #7

Next bugfixes , that´s great!
So here are all three fixes…
Maybe it will be good to have bug center for ET , where players can report stock ET bugs…


(nUllSkillZ) #8

http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=7384


(Jaquboss) #9

thanks nUllSkillZ…


(*Shadow* Commando) #10

Antoher bug, when level 3 engi, mines take more energy then in level 2
You can fix it like this:

In g_weapon.c

		if( ent->s.weapon == WP_LANDMINE ) {
			if( level.time - ent->client->ps.classWeaponTime > level.engineerChargeTime[ent->client->sess.sessionTeam-1] ) {
				ent->client->ps.classWeaponTime = level.time - level.engineerChargeTime[ent->client->sess.sessionTeam-1];
			}

			if( ent->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 3 ) {
				ent->client->ps.classWeaponTime += .66f * level.engineerChargeTime[ent->client->sess.sessionTeam-1];
			} else {
				ent->client->ps.classWeaponTime += .5f * level.engineerChargeTime[ent->client->sess.sessionTeam-1];
			}
		}

change the .66f to .33f


(Lanz) #11

I haven’t looked at the source code but this fix seems wrong, you’re disabling the skull and not the symtom, seems like a bad idea and breaking LMS mode.


(Demolama) #12

its possible… not like I have people to test out my mod on… I test what I can with what I have… then rely on the public to tell me how much I fucked up

:stuck_out_tongue:


(Catscratch) #13

I’ve been fighting with that “when changing teams dead icon does not disappear after spawning” bug for a couple of hours now. Here’s what I ended up doing…

In g_client.c I replaced…


client->ps.persistant[PERS_RESPAWNS_LEFT] = lives_left;

with…


if( g_axismaxlives.integer > 0 || g_alliedmaxlives.integer > 0 ) {
	client->ps.persistant[PERS_RESPAWNS_LEFT] = lives_left;
} else {
	client->ps.persistant[PERS_RESPAWNS_LEFT] = -1;
}

This seems to work. Comments? :???:


(Jaquboss) #14

That was briliant idea men !


(*Shadow* Commando) #15

Yes, this is much better fix then the one above.
Now the LMS mode also still works like it should.


(*Shadow* Commando) #16

Found another bug…
Sometimes after a map switch, axis or allied team is locked.
How to fix this one?


(bacon) #17

That’s not a bug. It happens when g_minplayers is set and the warmup countdown has begun.


(*Shadow* Commando) #18

Ah ok, how can i make sure that doesn’t happen, without switching the g_minplayers of again.


(*Shadow* Commando) #19

Sometimes the game crashes with the following error:
info_limbo_camera with no target
Can I somehow switch this off… Or is there a fix for this error
Currently I just disabled the errors in g_mover.c but i don’t know if that will fix the problem


(*Shadow* Commando) #20

Shadow Commando wrote:
Found another bug…
Sometimes after a map switch, axis or allied team is locked.
How to fix this one?

That’s not a bug. It happens when g_minplayers is set and the warmup countdown has begun.

Easy fix for this one:
In g_team.c
change

if( g_doWarmup.integer > 0 || (g_gametype.integer == GT_WOLF_LMS && g_lms_lockTeams.integer) ) {

to

if( /*g_doWarmup.integer > 0 ||*/ (g_gametype.integer == GT_WOLF_LMS && g_lms_lockTeams.integer) ) {