[DiscordArchive] Wouldn't the norm be to update the position with the homebind values using the DB?
[DiscordArchive] Wouldn't the norm be to update the position with the homebind values using the DB?
Archived author: Kitzunu • Posted: 2023-11-29T18:37:37.203000+00:00
Original source
now I am just working out some null crash
Archived author: Kitzunu • Posted: 2023-11-29T18:42:08.234000+00:00
Original source
stupid me putting variables wrong way around
Archived author: Bench • Posted: 2023-11-29T18:43:06.475000+00:00
Original source
Goose of a silly variety
Archived author: Kitzunu • Posted: 2023-11-29T18:43:57.638000+00:00
Original source
didnt help, am I stupid or how do I add a string to another string
Archived author: Nyeriah • Posted: 2023-11-29T18:45:10.394000+00:00
Original source
Why would you need that to begin with
Archived author: Kitzunu • Posted: 2023-11-29T18:45:22.020000+00:00
Original source
not add my bad
Archived author: Kitzunu • Posted: 2023-11-29T18:45:34.001000+00:00
Original source
basically what I am trying to do is str1 = str2
Archived author: Kitzunu • Posted: 2023-11-29T18:46:14.360000+00:00
Original source
trying to fix a fucked bug I managed to create with this
Archived author: Nyeriah • Posted: 2023-11-29T18:46:47.274000+00:00
Original source
Would need to see your code to be more helpful
tring> targetName, Optional<std:
tring> location)Archived author: Kitzunu • Posted: 2023-11-29T18:49:00.612000+00:00
Original source
```cpp
static bool HandleUnstuckCommand(ChatHandler* handler, Optional<std:
tring> targetName, Optional<std:
tring> location)
{
Player* player = handler->getSelectedPlayer();
if (!player && targetName)
{
player = ObjectAccessor::FindPlayerByName(*targetName);
if (!player)
{
ObjectGuid tGuid;
tGuid = sCharacterCache->GetCharacterGuidByName(*targetName);
if (!tGuid)
return false;
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
stmt->SetData(0, tGuid.GetCounter());
PreparedQueryResult res = CharacterDatabase.Query(stmt);
if (res)
{
Field* fields = res->Fetch();
WorldLocation loc(fields[0].Get<uint16>(), fields[2].Get<float>(), fields[3].Get<float>(), fields[4].Get<float>(), 0.0f);
uint32 zoneId = fields[1].Get<uint16>();
Player::SavePositionInDB(loc, zoneId, tGuid, nullptr);
return true;
}
}
}
if (targetName && !location)
location = targetName;
```
Basically everything works. Except when you have a selected target and the location arg is caught in targetName. (I have cut out the code unrelated to this)