Jump to content

Zombies still opening locked doors (Build 41.56)


HetCigarr

Recommended Posts

I have unsuccessfully tried to fix this bug myself before, so I was very excited by the latest patch note 

Quote

- Fixed zombies opening locked carpentry doors. 

So I went ahead and tested this on carpentry doors placed both in carpentry-doorframes and world-doorframes, in a new 45.46 savefile. In all instances the zombies still opened locked doors just like they previously did. 


I had suggested earlier that you should add ... && (!this.Locked || !this.isLockedByKey()) in IsoThumpable.class because I wasn't sure at the time which the correct boolean was. 
What you added in this patch is ... && !this.isLocked()

if (((IsoZombie)var1).cognition == 1 && this.isDoor() && !this.IsOpen() && !this.isLocked()) {

I'm convinced you just gotta use !this.isLockedByKey() instead. This shouldn't create any problems because ISLockDoor.Lua calls setLockedByKey(true); regardless if the players locks the door by key or without key (from the inside).

 

I don't think isLocked() or it's synomym Locked() is being used at all. 

Let's put an end to these wretched lockpickers:evil:

 

 

EDIT: Here's a bonus bug+fix. All types of crafted doors is indestructible by navigation+open door zombies, whenever the door is obstructed (Barricades is working as excepted though). thats because the zombie just loops at toggledoor -> door blocked -> toggledoor -> door blocked...
So dear gamemasters, just have a look this line, it should be a double-kill on these buzzing bugs
 

if (((IsoZombie)var1).cognition == 1 && this.isDoor() && !this.IsOpen() && !this.isLockedByKey() && !IsoDoor.isDoubleDoorObstructed(this) && !this.isObstructed())) {

Here I'm hoping checking a normal singledoor for !IsoDoor.isDoubleDoorObstructed() would just yield null which is the same as false(...right?). But If I'm wrong I guess you gotta throw in something like this inside the Thump instead

public void Thump(bla)
....blablabla  
boolean Obstructed = false;

  if (this.getSprite().getProperties().Is("DoubleDoor")) {
                    if (IsoDoor.isDoubleDoorObstructed(this)) {
                        Obstructed = true;
                   }     
                } else if (this.isObstructed()) {
                        Obstructed = true;
                    }
  
if (((IsoZombie)var1).cognition == 1 && this.isDoor() && !this.IsOpen() && !this.isLockedByKey() && !Obstructed )) {
    this.ToggleDoor((IsoGameCharacter)var1);
    return;
}

 

Edited by HetCigarr
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...