I think it would be better to check in this function whether or not it's the player entity being resolved in the collision rather than introducing a parameter variable to this function.