Two updates

* Remove unused code.
* Move function "getPlayerFlagValue" to compat.lua.