The waypoint usage here was missing a check that it has been
initialised properly. Without waypoint updating code assumed
that the flag has >0 max_health which caused many div by zero errors.
Added the following if check:
autocvar_g_ctf_flag_return_time ||
(autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health)
{
if((flag.ctf_status == FLAG_DROPPED) || (flag.ctf_status == FLAG_PASSING))
{
- if(flag.wps_flagdropped) { WaypointSprite_UpdateHealth(flag.wps_flagdropped, GetResource(flag, RES_HEALTH)); }
+ if (flag.wps_flagdropped
+ && (autocvar_g_ctf_flag_return_time || (autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health)))
+ {
+ WaypointSprite_UpdateHealth(flag.wps_flagdropped, GetResource(flag, RES_HEALTH));
+ }
if((GetResource(flag, RES_HEALTH) <= 0) || (time >= flag.ctf_droptime + autocvar_g_ctf_flag_return_time))
{