www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Next Generation Level Editor

Reply
 
Thread Tools
Old 23-10-18, 16:34   #461
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 3,298
Default

Do you need that answer to make a plugin? I do not think so.
So please post it in the proper thread.
AkyV is offline   Reply With Quote
Old 28-10-18, 23:55   #462
Krystian
Explorer
 
Join Date: May 2010
Posts: 847
Default

I have an important message to share:

There is a crucial bug in the FindFloorType function in Paolone's trng.cpp file, which in turn is used to supply some parameters used in the FLOOR structure. The function has some errors which prevent properly reading the floor type in some cases, which could lead to false "false" statements, even though they should return true (to be specific, the function omits parsing the subfunction parameters of floor data, also some problems occur in the case of sectors with floor and ceiling slats).

Lwmte has kindly inspected this function, and upon finding the faulty parts, has fixed the function so these errors no longer occur.
Here is the new and improved code for the FindFloorType function:
Code:
bool FindFloorType(WORD *pFloor, WORD Type)
{
    WORD **ptr2_FloorData = (WORD **) 0x533948;
    WORD *ptr_FloorData;
    int Index;
    WORD Status;

    Index=pFloor[0];

    if (Index == 0) return false;

    ptr_FloorData = *ptr2_FloorData;

    do {
        Status = ptr_FloorData[Index];
        WORD currType = Status & 0x1f;
        if (currType == Type) return true;
        Index += (currType <= 0x04) ? 2 : 1;
    }while ((Status & 0x8000)==0);

    return false;
}
I am aware of Paolone's notice that code in trng.cpp should not be changed or replaced, but given that the future prospects of TRNG updates seem very hazy, I think it might as well be replaced. If Paolone would ever come back and release a new TRNG update, he could just replace the old function with this one.

Last edited by Krystian; 28-10-18 at 23:57.
Krystian is offline   Reply With Quote
Old 29-10-18, 17:04   #463
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 3,298
Default

Thank you guys, for making/sharing it!
AkyV is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 15:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.