luciensadi / AwakeMUD

The Community Edition fork of the 'Awakened Worlds' Shadowrun 3 MUD codebase.
Other
55 stars 31 forks source link

Vehicle decay #650

Closed UndeadNappist closed 2 years ago

UndeadNappist commented 2 years ago

Adds WIP vehicle decay, including underlying logic for certain safety checks.

In dblist.cpp, the logic for decaying vehicle needs to be moved to where the handler is for timers on characters (wherever that is).

VEH_FLAGS logic is still a bit of a mystery to me, will do later.

UndeadNappist commented 2 years ago

Reached the upper limits of what I know what I'm doing. I know I have to insert

    // Decay smashed NPC/unowned vehicles.
    for (!((veh->in_veh) || (veh->in_room && ROOM_FLAGGED(veh->in_room, ROOM_GARAGE))) && (VEH_FLAGGED(veh, VFLAG_LOOTWRECK)) ) {
       if(GET_VEH_TIMER(veh) < 6) {
         GET_VEH_TIMER(veh)++;
       } else {
          veh->flags.RemoveBit(VFLAG_LOOTWRECK);
          extract_veh(veh);
           }
         }

somewhere into a loop for vehicles, but I have no idea where that goes.

Doesn't want to read the new var out of veh_data either.

UndeadNappist commented 2 years ago

I have no idea where or how to call the process_vehicle_decay() without crashing everything. Logic is based off how SPECIAL(paint) command works.