diff --git a/polymer/eduke32/source/gamestructures.c b/polymer/eduke32/source/gamestructures.c index 24631fcc5..b93cf000e 100644 --- a/polymer/eduke32/source/gamestructures.c +++ b/polymer/eduke32/source/gamestructures.c @@ -1218,6 +1218,12 @@ int32_t __fastcall VM_GetProjectile(register int32_t const iTile, register int32 projectile_t * const proj = g_tile[iTile].proj; + if (EDUKE32_PREDICT_FALSE(!proj)) + { + CON_ERRPRINTF("VM_GetProjectile: no projectile defined for tile %d\n", iTile); + return -1; + } + switch (lLabelID) { case PROJ_WORKSLIKE: lLabelID = proj->workslike; break; @@ -1266,6 +1272,12 @@ void __fastcall VM_SetProjectile(register int32_t const iTile, register int32_t projectile_t * const proj = g_tile[iTile].proj; + if (EDUKE32_PREDICT_FALSE(!proj)) + { + CON_ERRPRINTF("VM_SetProjectile: no projectile defined for tile %d\n", iTile); + return; + } + switch (lLabelID) { case PROJ_WORKSLIKE: proj->workslike = iSet; break;