- Fix gcc compile error

- Fix weapon null pointer crash
This commit is contained in:
Magnus Norddahl 2017-08-02 01:41:48 +02:00
parent aaa00cbcb9
commit 801fbddd47
2 changed files with 3 additions and 3 deletions

View file

@ -148,7 +148,7 @@ static bool CheckBBoxCircle(float *bbox, float x, float y, float radiusSquared)
}
template<typename Callback>
void BSPNodeWalkCircle(void *node, float x, float y, float radiusSquared, Callback &callback)
void BSPNodeWalkCircle(void *node, float x, float y, float radiusSquared, const Callback &callback)
{
while (!((size_t)node & 1))
{
@ -168,7 +168,7 @@ void BSPNodeWalkCircle(void *node, float x, float y, float radiusSquared, Callba
}
template<typename Callback>
void BSPWalkCircle(float x, float y, float radiusSquared, Callback &callback)
void BSPWalkCircle(float x, float y, float radiusSquared, const Callback &callback)
{
if (level.nodes.Size() == 0)
callback(&level.subsectors[0]);

View file

@ -420,7 +420,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
{
if (gl_lights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
{
FSpriteModelFrame *smf = gl_FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false);
FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? gl_FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false) : nullptr;
if (smf)
gl_SetDynModelLight(playermo, true);
else