Not answered help guild system buildings

Sep
Threads
6
40
1
2
8
HubMoney
192
Kırmızı Yazı ve Link

AD: MetinTwo - Feel the Real Metin Experience! - Coming Soon CLICK FOR PRESENTATION!

Hi team,

1) I have an issue with buildings in the guild land. The issue happens only when I sur Z rotation and in the player.object in sql it add the related value in z_rot. If I put 0 in the z_rot or if I remove the z_rotation option in the client, the problem is "solved".

Do you know what can cause this problem?


syserr/syslog ( I ried with an item without Z_rotation and with an item with Z_rotation:

(Without z_rotation)
Nov 5 17:44:39 :: COMMAND: Magic: build
Nov 5 17:44:39 :: BUILDING: FindLand 1 434808 944740
Nov 5 17:44:39 :: RequestCreateObject(vnum=14300, map=1, pos=(25054,49046), rot=(0.0,0.0,0.0) region(409600,896000 ~ 512000,1024000)
Nov 5 17:44:39 :: BUILD: material 0 90010 5
Nov 5 17:44:39 :: OBJ: id 20 vnum 14300 map 1 pos 434654x945046
Nov 5 17:44:39 :: ObjectInsertPacket vid 35132 vnum 14300 rot 0.000000 0.000000 0.000000

(with z_rotation)
Nov 5 17:45:38 :: COMMAND: Magic: build
Nov 5 17:45:38 :: BUILDING: FindLand 1 434808 944740
Nov 5 17:45:38 :: RequestCreateObject(vnum=14300, map=1, pos=(25397,49088), rot=(0.0,0.0,38.0) region(409600,896000 ~ 512000,1024000)
SYSERR: Nov 5 17:45:38 :: ForAttrRegionFreeAngle: SECTREE_MANAGER::ForAttrRegion - Unhandled exception. MapIndex: 1
Nov 5 17:45:38 :: BUILD: material 0 90010 5
Nov 5 17:45:38 :: OBJ: id 21 vnum 14300 map 1 pos 434997x945088
Nov 5 17:45:38 :: ObjectInsertPacket vid 35133 vnum 14300 rot 0.000000 0.000000 38.000000
SYSERR: Nov 5 17:45:38 :: ForAttrRegionFreeAngle: SECTREE_MANAGER::ForAttrRegion - Unhandled exception. MapIndex: 1



I mean, it doesn't affect nothing so I could just remove the error message from source code but I don't know what do you think? thank you

bool SECTREE_MANAGER::ForAttrRegionFreeAngle( long lMapIndex, long lCX, long lCY, long lCW, long lCH, long lRotate, DWORD dwAttr, EAttrRegionMode mode )
{
float fx1 = (-lCW/2) * sinf(float(lRotate)/180.0f*3.14f) + (-lCH/2) * cosf(float(lRotate)/180.0f*3.14f);
float fy1 = (-lCW/2) * cosf(float(lRotate)/180.0f*3.14f) - (-lCH/2) * sinf(float(lRotate)/180.0f*3.14f);

float fx2 = (+lCW/2) * sinf(float(lRotate)/180.0f*3.14f) + (-lCH/2) * cosf(float(lRotate)/180.0f*3.14f);
float fy2 = (+lCW/2) * cosf(float(lRotate)/180.0f*3.14f) - (-lCH/2) * sinf(float(lRotate)/180.0f*3.14f);

float fx3 = (-lCW/2) * sinf(float(lRotate)/180.0f*3.14f) + (+lCH/2) * cosf(float(lRotate)/180.0f*3.14f);
float fy3 = (-lCW/2) * cosf(float(lRotate)/180.0f*3.14f) - (+lCH/2) * sinf(float(lRotate)/180.0f*3.14f);

float fx4 = (+lCW/2) * sinf(float(lRotate)/180.0f*3.14f) + (+lCH/2) * cosf(float(lRotate)/180.0f*3.14f);
float fy4 = (+lCW/2) * cosf(float(lRotate)/180.0f*3.14f) - (+lCH/2) * sinf(float(lRotate)/180.0f*3.14f);

float fdx1 = fx2 - fx1;
float fdy1 = fy2 - fy1;
float fdx2 = fx1 - fx3;
float fdy2 = fy1 - fy3;

if (0 == fdx1 || 0 == fdx2)
{
sys_err( "SECTREE_MANAGER::ForAttrRegion - Unhandled exception. MapIndex: %d", lMapIndex );
return false;
}

float fTilt1 = float(fdy1) / float(fdx1);
float fTilt2 = float(fdy2) / float(fdx2);
float fb1 = fy1 - fTilt1*fx1;
float fb2 = fy1 - fTilt2*fx1;
float fb3 = fy4 - fTilt1*fx4;
float fb4 = fy4 - fTilt2*fx4;

float fxMin = min(fx1, min(fx2, min(fx3, fx4)));
float fxMax = max(fx1, max(fx2, max(fx3, fx4)));
for (int i = int(fxMin); i < int(fxMax); ++i)
{
float fyValue1 = fTilt1*i + min(fb1, fb3);
float fyValue2 = fTilt2*i + min(fb2, fb4);

float fyValue3 = fTilt1*i + max(fb1, fb3);
float fyValue4 = fTilt2*i + max(fb2, fb4);

float fMinValue;
float fMaxValue;
if (abs(int(fyValue1)) < abs(int(fyValue2)))
fMaxValue = fyValue1;
else
fMaxValue = fyValue2;
if (abs(int(fyValue3)) < abs(int(fyValue4)))
fMinValue = fyValue3;
else
fMinValue = fyValue4;

for (int j = int(min(fMinValue, fMaxValue)); j < int(max(fMinValue, fMaxValue)); ++j) {
if ( ForAttrRegionCell( lMapIndex, lCX + (lCW / 2) + i, lCY + (lCH / 2) + j, dwAttr, mode ) )
return true;
}
}

return mode == ATTR_REGION_MODE_CHECK ? false : true;
}

2) Also. I have a second issue with "information guild land" tab that is not working, also after I buy the terrain and I put a building, it doesn't do nothing when I click on the tab.


bug.JPG
 
Last edited:
Metin2Hub Bot
M2Hub Bot
Feb
Threads
65
2,217
2
1,066
113
HubMoney
1,439
Hi team,

1) I have an issue with buildings in the guild land. The issue happens only when I sur Z rotation and in the player.object in sql it add the related value in z_rot. If I put 0 in the z_rot or if I remove the z_rotation option in the client, the problem is "solved".

Do you know what can cause this problem?

syserr/syslog

Nov 5 16:22:00 :: RequestCreateObject(vnum=14304, map=41, pos=(62355,69748), rot=(0.0,0.0,32.0) region(921600,204800 ~ 1024000,332800)
SYSERR: Nov 5 16:22:00 :: ForAttrRegionFreeAngle: SECTREE_MANAGER::ForAttrRegion - Unhandled exception. MapIndex: 41 <---- ERROR

I mean, it doesn't affect nothing so I could just remove the error message from source code but I don't know what do you think? thank you



2) Also. I have a second issue with "information guild land" tab that is not working, also after I buy the terrain and I put a building, it doesn't do nothing when I click on the tab.


View attachment 2566

Hello dear user,

Your post will be under surveillance by bots for the next few hours.

Forum description : Metin2 private server, Metin2 download, Metin2 support, Metin2 Forum, Metin2 Pvp Servers, Errors, Bugs, Requests, Metin2 Pvp Forum, Everything About Metin2.
 
Sep
Threads
6
40
1
2
8
HubMoney
192
Update for the second issue: I have unlocked that tab and I can now working on it. Do you know how I can show the buildings that the guild has?
or do you have any resources where I can read and learn how it works? (Show db elements through python in the game)