diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 33ce19e19..61a5e6285 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1168,6 +1168,9 @@ const memberlabel_t UserdefsLabels[]= { "m_gametypeflags", USERDEFS_M_GAMETYPEFLAGS, 0, 0 }, { "globalflags", USERDEFS_GLOBALFLAGS, 0, 0 }, { "globalgameflags", USERDEFS_GLOBALGAMEFLAGS, 0, 0 }, + { "vm_player", USERDEFS_VM_PLAYER, 0, 0 }, + { "vm_sprite", USERDEFS_VM_SPRITE, 0, 0 }, + { "vm_distance", USERDEFS_VM_DISTANCE, 0, 0 }, { "", -1, 0, 0 } // END OF LIST }; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 08f21ac2d..c9247740b 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -472,6 +472,9 @@ enum UserdefsLabel_t USERDEFS_M_GAMETYPEFLAGS, USERDEFS_GLOBALFLAGS, USERDEFS_GLOBALGAMEFLAGS, + USERDEFS_VM_PLAYER, + USERDEFS_VM_SPRITE, + USERDEFS_VM_DISTANCE, USERDEFS_END }; diff --git a/polymer/eduke32/source/gamestructures.c b/polymer/eduke32/source/gamestructures.c index 6bdd6f0c3..54a8dcbe0 100644 --- a/polymer/eduke32/source/gamestructures.c +++ b/polymer/eduke32/source/gamestructures.c @@ -170,6 +170,9 @@ int32_t __fastcall VM_GetUserdef(register int32_t lLabelID) case USERDEFS_M_GAMETYPEFLAGS: lLabelID = GametypeFlags[ud.m_coop]; break; case USERDEFS_GLOBALFLAGS: lLabelID = globalflags; break; case USERDEFS_GLOBALGAMEFLAGS: lLabelID = duke3d_globalflags; break; + case USERDEFS_VM_PLAYER: lLabelID = vm.g_p; break; + case USERDEFS_VM_SPRITE: lLabelID = vm.g_i; break; + case USERDEFS_VM_DISTANCE: lLabelID = vm.g_x; break; default: lLabelID = -1; break; } @@ -286,6 +289,9 @@ void __fastcall VM_SetUserdef(register int32_t const lLabelID, register int32_t case USERDEFS_M_ORIGIN_Y: ud.m_origin.y = iSet; break; case USERDEFS_GLOBALFLAGS: globalflags = iSet; break; case USERDEFS_GLOBALGAMEFLAGS: duke3d_globalflags = iSet; break; + case USERDEFS_VM_PLAYER: vm.g_p = iSet; vm.g_pp = g_player[iSet].ps; break; + case USERDEFS_VM_SPRITE: vm.g_i = iSet; vm.g_sp = &sprite[iSet]; vm.g_t = &actor[iSet].t_data[0]; break; + case USERDEFS_VM_DISTANCE: vm.g_x = iSet; break; default: break; } }