Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [CODE] Mining above doors exploit fix
[CODE] Mining above doors exploit fix [message #493631] Sun, 29 December 2024 18:53
iRANian is currently offline  iRANian
Messages: 4309
Registered: April 2011
Karma: 0
General (4 Stars)
Think this code is DA only?

This code is a c4 detonation request hook, it blocks detonation if the z-height is too low. Basically it adds a custom z-height distance check for detonation, doesn't change x and y.

After this fix players can just walk into doors with getting blown up by mines placed above the doors.

bool Main_Hooks::C4_Detonate_Request_Event(C4GameObj *C4, SmartGameObj *Triggerer) {

    // Proxy c4 only
    if (Get_C4_Mode(C4) == 3) {

        float TriggerZ = Commands->Get_Position(Triggerer).Z;
        float C4Z = Commands->Get_Position(C4).Z;

        // Fix Proxy c4 damage when mining above doors glitch
        if (abs(C4Z - TriggerZ) > 2.f) {
            return false;
        }

        //DA::Host_Message("C4 Z: %f, trigger Z: %f", Commands->Get_Position(C4).Z, Commands->Get_Position(Triggerer).Z);
    }
    return true;
}

You'll want to remove the abs(), cause it will prevent triggering when the player is above the proxy too. Haven't tested it without abs() but ought to work. Just test it with the abs() first before doing without abs().


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sun, 29 December 2024 18:54]

Report message to a moderator

Previous Topic: [Map] C&C_MesaForest_Unlv2
Next Topic: Readme before posting a release
Goto Forum:
  


Current Time: Sun Jan 05 08:02:53 MST 2025

Total time taken to generate the page: 0.00652 seconds