mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Simplify PM_CalculateWaterLevelForDemo
This commit is contained in:
parent
74c8c60e38
commit
120bb86458
1 changed files with 2 additions and 18 deletions
|
@ -1282,35 +1282,19 @@ void PM_CalculateWaterLevelForDemo()
|
||||||
{
|
{
|
||||||
vec3_t point;
|
vec3_t point;
|
||||||
int cont;
|
int cont;
|
||||||
float sample1;
|
|
||||||
float sample2;
|
|
||||||
|
|
||||||
point[0] = pml.origin[0];
|
point[0] = pml.origin[0];
|
||||||
point[1] = pml.origin[1];
|
point[1] = pml.origin[1];
|
||||||
|
point[2] = pml.origin[2] + pm->viewheight;
|
||||||
|
|
||||||
pm->waterlevel = 0;
|
pm->waterlevel = 0;
|
||||||
pm->watertype = 0;
|
pm->watertype = 0;
|
||||||
|
|
||||||
sample2 = pm->viewheight - pm->mins[2];
|
|
||||||
sample1 = sample2 / 2;
|
|
||||||
|
|
||||||
point[2] = pml.origin[2] + pm->mins[2] + 1;
|
|
||||||
cont = pm->pointcontents(point);
|
cont = pm->pointcontents(point);
|
||||||
|
|
||||||
if ((cont & MASK_WATER) != 0) {
|
if ((cont & MASK_WATER) != 0) {
|
||||||
pm->watertype = cont;
|
|
||||||
pm->waterlevel = 1;
|
|
||||||
point[2] = pml.origin[2] + pm->mins[2] + sample1;
|
|
||||||
cont = pm->pointcontents(point);
|
|
||||||
|
|
||||||
if ((cont & MASK_WATER) != 0) {
|
|
||||||
pm->waterlevel = 2;
|
|
||||||
point[2] = pml.origin[2] + pm->mins[2] + sample2;
|
|
||||||
cont = pm->pointcontents(point);
|
|
||||||
|
|
||||||
if ((cont & MASK_WATER) != 0)
|
|
||||||
pm->waterlevel = 3;
|
pm->waterlevel = 3;
|
||||||
}
|
pm->watertype = cont;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue