| 1896 | //--------------------------------------------------------------------------- |
| 1897 | |
| 1898 | void PlayerSectorBound(DSWPlayer* pp, double amt) |
| 1899 | { |
| 1900 | if (!pp->insector()) |
| 1901 | return; |
| 1902 | |
| 1903 | double cz,fz; |
| 1904 | |
| 1905 | // player should never go into a sector |
| 1906 | |
| 1907 | // was getting some problems with this |
| 1908 | // when jumping onto hight sloped sectors |
| 1909 | |
| 1910 | // call this routine to make sure he doesn't |
| 1911 | // called from DoPlayerMove() but can be called |
| 1912 | // from anywhere it is needed |
| 1913 | |
| 1914 | calcSlope(pp->cursector, pp->GetActor()->getPosWithOffsetZ(), &cz, &fz); |
| 1915 | |
| 1916 | if (pp->GetActor()->getOffsetZ() > fz - amt) |
| 1917 | pp->posZset(fz - amt); |
| 1918 | |
| 1919 | if (pp->GetActor()->getOffsetZ() < cz + amt) |
| 1920 | pp->posZset(cz + amt); |
| 1921 | |
| 1922 | } |
| 1923 | |
| 1924 | //--------------------------------------------------------------------------- |
| 1925 | // |
no test coverage detected