corpse hitboxes


(tjw) #1

Does anyone know how to lower the hitboxes ( a.k.a. ps.maxs[2] ) when a player is wounded? It seems to be set to CROUCH_VIEWHEIGHT in vanilla et. I’ve tried lowering it, and it works, but bodies are getting stuck into walls when they are revived.


(Rain) #2

What did you lower it to, and where did you do it?


(tjw) #3

Hi Rain.

Initially I tried ingoring ydnar’s warning and adjusting it in player_die() g_combat.c:


	// ydnar: so bodies don't clip into world
	self->r.maxs[2] = self->client->ps.crouchMaxZ;	
	self->client->ps.maxs[2] = self->client->ps.crouchMaxZ;

I’ve come to the conclusion now that if the client->ps.maxs[2] is anything less than 12 the player will get stuck in things. I haven’t found a good solution for fixing this.

However, I have come up with a rather ugly workaround. That is to lower the maxs[2] temporarily in Bullet_Fire_Extended() in g_weapon.c when a player is hit and re-run the trace. Then I turn it back up to what it was prior. It’s a work in progress, but I think I’m finally getting the “stuck in wall” problem sorted out. See:

http://et.tjw.org/etpub/hitboxes/

Is there a better way?


(bani) #4

there really isnt any better way, unless you want to fundamentally change the way revives are done.

etpro uses a similar technique to what you’re using.


(Demolama) #5

yea Im having the same problem… where if I lower the corpse boxes they’ll get stuck into stuff… it really sucks :frowning:


(Chruker) #6

Demoman, reread the last part of tjw’s last post. He found a workaround.


(Demolama) #7

I read it but I dont agree with it. Why would you change code in a function that has nothing to do with reviving a corpse? its doing too much work in a place its not needed


(bani) #8

tjw’s solution is actually pretty efficient and should work fine.


(tjw) #9

Thanks bani. It’s good to know I wasn’t missing something obvious.


(DrPepper) #10

Speaking of hit boxes :smiley: are bounding boxes and hit boxes the same thing?