Need help with broken buttons in mod Created 3 years ago2020-06-11 11:19:07 UTC by Petko Petko

Created 3 years ago2020-06-11 11:19:07 UTC by Petko Petko

Posted 3 years ago2020-06-11 11:19:07 UTC Post #344391
I have no idea whats causing this issue, I looked throught my code and compared it to the original using winmerge, but I didnt find anything that could be causing this, I tried reverting the entire buttons.cpp to the original, but nothing seems to help. And by broken buttons I dont only mean broken func_buttons, I think CBaseToggle might be broken beacuse buttons and npcs are broken too. Btw by broken I mean they can only be interacted with only one side.
Posted 3 years ago2020-06-11 16:28:42 UTC Post #344392
What are the changes between your code and the original?
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 years ago2020-06-11 17:29:30 UTC Post #344394
Have you tried cleaning and building again the solution?
Posted 3 years ago2020-06-11 19:16:32 UTC Post #344395
I reverted the buttons code to the original as I said, but there are a few minor changes, here are all the lines added to the original buttons code:
#define SF_BUTTON_ONLYDIRECT    16 // LRC

int        CBaseButton::ObjectCaps()
{
    return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) |
        (pev->takedamage ? 0 : FCAP_IMPULSE_USE) |
        (pev->spawnflags & SF_BUTTON_ONLYDIRECT ? FCAP_ONLYDIRECT_USE : 0);
}

    if (IsLockedByMaster()) return;
I did not remove ANY lines from the original code

btw I clean the solution, and recompile after adding new weapons
Posted 3 years ago2020-06-12 10:41:01 UTC Post #344396
Is your mod's code really original or is it based on SoHL source code? I think that the ONLYDIRECT define hints that it is. IIRC SoHL 1.2 has certain problems with Toggle on func_rot_buttons, but as for usual func_buttons, I'm not sure.

In what way do buttons and NPCs appear broken?
Posted 3 years ago2020-06-12 12:17:39 UTC Post #344397
sorry, I didnt mention its based on SoHL, i just usally add entities to my mod, and not complete features, like my mod doesnt have movewith, the only major modification I made to my mod was just adding the env_sky and the things needed for it to work in view.cpp, I think I based the buttons.cpp code modifications on the sohl 1.2 version, I made a reddit post about this 15 days ago, I have a vid there about the glitch, the link is here
Posted 3 years ago2020-06-12 14:10:57 UTC Post #344398
Check the player use code in player.cpp. Maybe it's got something to do with that. SoHL added some sorta traceline to check if the player's view of the button is obstructed by any world brushes, and chances are, the SoHL "direct use" flag is messing with vanilla HL use code.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 years ago2020-06-12 18:10:50 UTC Post #344399
Admer456, I replaced the use code with soHLs use code, it fixed the issue, thx for help, finally this issue is fixed.
You must be logged in to post a response.