Sigoles
Discord: @sigoles
- Joined
- Nov 20, 2015
- Messages
- 1,200
- Solutions
- 2
- Reaction score
- 149
I am trying to create a code in which when the player has logged in mounted, its login with mount.
but there's an error:
C++:
uint8_t currentMountId2 = player->getCurrentMount();
if (currentMountId2 > 0) {
Mount* currentMount2 = g_game.mounts.getMountByID(currentMountId2);
if (currentMount2) {
if (!player->hasMount(currentMount2)) {
player->setCurrentMount(currentMount2);
}
}
}
but there's an error:
Code:
/home/Otserver/src/iologindata.cpp: In static member function ‘static bool IOLoginData::loadPlayer(Player*, DBResult_ptr)’:
/home/Otserver/src/iologindata.cpp:720:42: error: invalid conversion from ‘Mount*’ to ‘uint8_t {aka unsigned char}’ [-fpermissive]
player->setCurrentMount(currentMount2);
^
In file included from /home/Otserver/src/iologindata.h:24:0,
from /home/Otserver/src/iologindata.cpp:24:
/home/Otserver/src/player.h:172:8: error: initializing argument 1 of ‘void Player::setCurrentMount(uint8_t)’ [-fpermissive]
void setCurrentMount(uint8_t mountId);
Last edited by a moderator: