Co2 Bridge

04/17/2010 23:31 Ethrel#1
Ok. SO I have been working on a copy of the CO2 pserv and my tester pointed out that the bridges don't work.

I don't really have a whole lot of compiled-source experience, however have been a web programmer for a number of years now (8+), so I get the basics, I'm just not completely comfortable with the environment yet.

Thus far I have figured out that the tiles are reported as inaccessible and that when you try to move onto the bridge, it sends a 0x3f2 packet to the server (subtype 138). I would assume this is some form of 'enter bridge' sequence as this only happens when trying to walk on the bridge.

Does anyone have any ideas about how to get the bridges working properly?

And no, I am not looking for that stupid if(Tiles[x,y]==1) return true; crap. That doesn't fix it, it just hides it.

------------- EDIT -------------
So. Looking at the code, the best I could come up with was a manual override for the bridge walk. In PacketProcessor.cs within the 0x3f2 region's switch, add:
Code:
case 138: // enter bridge ?
  {
    Struct.DmapData Map = Nano.Maps[(int)CSocket.Client.Map];
    Map.OverrideAccess = true;
    break;
  }
and in DmapData.cs within the class add:
Code:
public bool OverrideAccess = false;
and the if statement in CheckLoc should look like this:
Code:
if(Tiles[x,y] == 1)
  {
    return true;
  }
else
  {
    if(OverrideAccess == true)
      {
        OverrideAccess = false;
        return true;
      }
    else
      {
        return false;
      }
  }
Now, this will cause some issues with smooth movement (it will report an invalid coord every tile and stop movement for a second), but it works without completely disabling it.

You can also just return OverrideAccess without disabling it at any point which will allow smooth walking and such, but in my (very very short) test, it seemed to cause some extra issues.

Basically, this seems to be a partially-working patch for the bridge that still needs improvements...
04/18/2010 03:36 pro4never#2
I'd suggest using the Dmap system that korvak released. I'm fairly sure it has to do with scene files not being loaded into the source properly.

It's either that or the tiles were marked as different from normal ground and you have to add an exception for that tile value (cause there was a workaround for the original coemu where you would change a few lines to add an exception for them)


Regardless: The one released by korvaks should work perfectly for all dmaps/scene files being loaded.
04/18/2010 03:39 s.bat#3
It seems like your issue is similar to a comment described in [Only registered and activated users can see links. Click Here To Register...] thread:
Quote:
Originally Posted by Korvacs
The .dll loads the entire dmap file, and scene files, so you dont need to worry about bridges being marked as invalid and things like that.
I'm not sure, but you should look into Korvac's DmapLoader.dll. Maybe someone with more knowledge on the subject could confirm if what I quoted from Korvac's thread is indeed the problem here.

Edit. Damn it.
04/19/2010 05:57 Ethrel#4
Took me some time, but I finally got everything setup and working. Thanks for the info, both of you :)