PMove: Define waterlevels more appropriately. Add WATERLEVEL_{OUTSIDE,KNEE,CHEST,SUBMERGED} types.
This commit is contained in:
parent
8532f1264f
commit
8729e973ad
2 changed files with 12 additions and 4 deletions
|
@ -22,6 +22,14 @@ int trace_endcontentsi;
|
||||||
.vector basevelocity;
|
.vector basevelocity;
|
||||||
.entity groundentity;
|
.entity groundentity;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
WATERLEVEL_OUTSIDE,
|
||||||
|
WATERLEVEL_KNEE,
|
||||||
|
WATERLEVEL_CHEST,
|
||||||
|
WATERLEVEL_SUBMERGED
|
||||||
|
} waterlevel_e;
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
void PMove_StartFrame(void);
|
void PMove_StartFrame(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -131,16 +131,16 @@ PMoveCustom_Categorize(void)
|
||||||
if (PMoveCustom_Contents(self.origin + self.maxs - [0,0,1])
|
if (PMoveCustom_Contents(self.origin + self.maxs - [0,0,1])
|
||||||
& CONTENTBITS_FLUID)
|
& CONTENTBITS_FLUID)
|
||||||
{
|
{
|
||||||
self.waterlevel = 3;
|
self.waterlevel = WATERLEVEL_SUBMERGED;
|
||||||
} else {
|
} else {
|
||||||
self.waterlevel = 2;
|
self.waterlevel = WATERLEVEL_CHEST;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.waterlevel = 1;
|
self.waterlevel = WATERLEVEL_KNEE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.watertype = CONTENT_EMPTY;
|
self.watertype = CONTENT_EMPTY;
|
||||||
self.waterlevel = 0;
|
self.waterlevel = WATERLEVEL_OUTSIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue