Code: Select all
DWORD FASTCALL Cube_RedPortal(Game* ptGame, Unit* ptChar)
{
Position pos;
D2COMMON_D2GetPosition(ptChar, &pos);
int ret = OpenRedPortal(ptGame, ptChar, 38); //38 - Tristram
return ret;
}
But I try to make the custom level number on the cubemain, it crashed
Code: Select all
D2FUNC(D2COMMON, D2GetCubeMainTxt, CubeMainTxt*, __stdcall, (DWORD cubemainID), 0x1B890)
DWORD FASTCALL Cube_RedPortal(Game* ptGame, Unit* ptChar)
{
CubeMainTxt* pCube = D2COMMON_D2GetCubeMainTxt(ptChar->nTxtFileNo);
Position pos;
D2COMMON_D2GetPosition(ptChar, &pos);
int ret = OpenRedPortal(ptGame, ptChar, pCube->value);
return ret;
}