@@ -618,6 +618,7 @@ public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] n
618618 }
619619
620620 if (convar .BoolValue ) add_prebuilts_to_cache (" func_button" , true );
621+ if (convar .BoolValue ) add_prebuilts_to_cache (" func_rot_button" , true );
621622 }
622623}
623624
@@ -1219,6 +1220,7 @@ public void Shavit_LoadZonesHere()
12191220 if (gCV_ClimbButtons .BoolValue )
12201221 {
12211222 add_prebuilts_to_cache (" func_button" , true );
1223+ add_prebuilts_to_cache (" func_rot_button" , true );
12221224 }
12231225}
12241226
@@ -1329,6 +1331,7 @@ public void OnGameFrame()
13291331 if (search_func_button )
13301332 {
13311333 FindEntitiesToHook (" func_button" , ZoneForm_func_button );
1334+ FindEntitiesToHook (" func_rot_button" , ZoneForm_func_button );
13321335 }
13331336}
13341337
@@ -3017,6 +3020,23 @@ void OpenHookMenu_List(int client, int form, int pos = 0)
30173020 list .PushArray (thing );
30183021 }
30193022
3023+ // copy & paste for func_rot_button because it's shrimple and I can't think of how to do it cleanly otherwise right now
3024+ if (form == ZoneForm_func_button )
3025+ {
3026+ while ((ent = FindEntityByClassname (ent , " func_rot_button" )) != - 1 )
3027+ {
3028+ if (gI_EntityZone [ent ] > - 1 ) continue ;
3029+
3030+ float ent_origin [3 ];
3031+ GetEntPropVector (ent , Prop_Send , " m_vecOrigin" , ent_origin );
3032+
3033+ ent_list_thing thing ;
3034+ thing .dist = GetVectorDistance (player_origin , ent_origin );
3035+ thing .ent = ent ;
3036+ list .PushArray (thing );
3037+ }
3038+ }
3039+
30203040 if (! list .Length )
30213041 {
30223042 Shavit_PrintToChat (client , " No unhooked entities found" );
@@ -3067,7 +3087,7 @@ bool TeleportFilter(int entity)
30673087 char classname [20 ];
30683088 GetEntityClassname (entity , classname , sizeof (classname ));
30693089
3070- if (StrEqual (classname , " trigger_teleport" ) || StrEqual (classname , " trigger_multiple" ) || StrEqual (classname , " func_button" ))
3090+ if (StrEqual (classname , " trigger_teleport" ) || StrEqual (classname , " trigger_multiple" ) || StrEqual (classname , " func_button" ) || StrEqual ( " func_rot_button " ) )
30713091 {
30723092 //TR_ClipCurrentRayToEntity(MASK_ALL, entity);
30733093 gI_CurrentTraceEntity = entity ;
@@ -3116,7 +3136,7 @@ public int MenuHandle_HookZone_Form(Menu menu, MenuAction action, int param1, in
31163136 char classname [32 ];
31173137 GetEntityClassname (ent , classname , sizeof (classname ));
31183138
3119- if (StrEqual (classname , " func_button" ))
3139+ if (StrEqual (classname , " func_button" ) || StrEqual ( classname , " func_rot_button " ) )
31203140 {
31213141 form = ZoneForm_func_button ;
31223142 }
0 commit comments