• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Potrzebna pomoc osoby obeznanej.

LOC0SO

New Member
Joined
May 13, 2009
Messages
97
Reaction score
3
Witam,

Mam problem na moim serwerze taki, że gdy drabina(ladder) jest w domku(owner nobody oraz gdy ma właściciela) postać nie może jej użyć, a w silniku pojawia się błąd:
Code:
luaDoTeleportThing<>. Can not teleport thing.

Za to gdy drabina jest w pz lub obojętnie w jakim miejscu na mapie to można jej użyć...

W domku również nie działają komendy takie jak /up /t itp. za to poza domkiem wszystko działa normalnie.

Macie pomysł jaka jest przyczyna ?
 
Bo pewnie ta Twoja funkcja doTelepotThing to taka wredna jest i patrzy czy na pozycji na ktora ma teleportowac dana rzecz jest np. domek i jesli jest to mowi, ze co bedziesz po domkach latal i w ogole i nie teleportuje.
 
Nie jestem obrzezany w tym temacie, zobacz w cpp czy nic się nie koliduje z tym czy drabinka jest w "house" czy nie.
 
Code:
int LuaScriptInterface::luaDoTeleportThing(lua_State *L)
{
	//doTeleportThing(uid, newpos)
	PositionEx pos;
	popPosition(L, pos);
	uint32_t uid = popNumber(L);

	ScriptEnviroment* env = getScriptEnv();

	Thing* tmp = env->getThingByUID(uid);
	if(tmp){
		if(g_game.internalTeleport(tmp, pos) == RET_NOERROR){
			lua_pushnumber(L, LUA_NO_ERROR);
		}
		else{
			reportErrorFunc("Can not teleport thing.");
			lua_pushnumber(L, LUA_ERROR);
		}
	}
	else{
		reportErrorFunc(getErrorDesc(LUA_ERROR_THING_NOT_FOUND));
		lua_pushnumber(L, LUA_ERROR);
	}
	return 1;
}

Macie jakis pomysl ?
 
A dodałeś to do registerFunctions() ? Bo jak nie to nawet nie zaimplementowało ...

Code:
	//doTeleportThing(uid, newpos)
	lua_register(m_luaState, "doTeleportThing", LuaScriptInterface::luaDoTeleportThing);
 
Ale to wtedy chyba by wogole nie teleportowalo...
a drabina działa, tylko nie w domu
 
Kto teraz ma drabiny w domkach, bądź cywilizowany i montuj schody chłopie! Albo teleport!
 
Po to chyba są by z nich korzystać.

Schody pobierają za dużo miejsca, teleport w domku by wejść piętro wyżej ??
 
Fresh dobrze mowi zamontuj schody! albo portale czasoprzestrzenne
 
Code:
	//doTeleportThing(uid, newpos)
	lua_register(m_luaState, "doTeleportThing", LuaScriptInterface::luaDoTeleportThing);
Sprawdzilem było to tam od początku...

@aelo
Po co się odzywasz jak nie wnosisz nic do tematu ?
 
Nom, a potem w Newsie typek napisze, "uwaga dzisiaj wgramy nowy update! Jako jedyny ots postanawiamy wprowadzić schody zamiast drabin w domkach, jesteśmy pierwszym tego typu ots'em to dowodzi jak bardzo się angażujemy w to i jak bardzo profesjonalną ekipą jesteśmy. Do zmiany na mapie zatrudniliśmy profesjonalną firmę maperską!"
 
A dodałeś to do registerFunctions() ? Bo jak nie to nawet nie zaimplementowało ...

Code:
    //doTeleportThing(uid, newpos)
    lua_register(m_luaState, "doTeleportThing", LuaScriptInterface::luaDoTeleportThing);

Przeciez gdyby funkcja nie byla zarejstrowana, to by mial blad, ze funkcja nie istnieje i nie moze jej wywolac?

@Topic:
Sprawdz funkcje internalTeleport w game.
 
@UP
Code:
ReturnValue Game::internalTeleport(Thing* thing, const Position& newPos, uint32_t flags /*= 0*/)
{
	if(newPos == thing->getPosition())
		return RET_NOERROR;
	else if(thing->isRemoved())
		return RET_NOTPOSSIBLE;

	Tile* toTile = getTile(newPos.x, newPos.y, newPos.z);
	if(toTile){
		if(Creature* creature = thing->getCreature()){
			// checks if player is being teleported to a house: if yes and if he doesn't have
			// the necessary flag and is not the owner of the house returns error
			if(Player* player = creature->getPlayer()){
				HouseTile* houseTile = player->getTile()->getHouseTile();
				if(houseTile){
					House* house = houseTile->getHouse();
					if(house && house->isInvited(player)){
						return RET_NOTPOSSIBLE;
					}
				}
			}

			creature->getTile()->moveCreature(creature, toTile, true);
			return RET_NOERROR;
		}
		else if(Item* item = thing->getItem()){
			return internalMoveItem(item->getParent(), toTile, INDEX_WHEREEVER, item, item->getItemCount(), NULL, flags);
		}
	}

	return RET_NOTPOSSIBLE;
}

Problem pojawia się taki że właściciel także nie może użyć drabiny
 
@UP
Code:
ReturnValue Game::internalTeleport(Thing* thing, const Position& newPos, uint32_t flags /*= 0*/)
{
	if(newPos == thing->getPosition())
		return RET_NOERROR;
	else if(thing->isRemoved())
		return RET_NOTPOSSIBLE;

	Tile* toTile = getTile(newPos.x, newPos.y, newPos.z);
	if(toTile){
		if(Creature* creature = thing->getCreature()){
			// checks if player is being teleported to a house: if yes and if he doesn't have
			// the necessary flag and is not the owner of the house returns error
			if(Player* player = creature->getPlayer()){
				HouseTile* houseTile = player->getTile()->getHouseTile();
				if(houseTile){
					House* house = houseTile->getHouse();
					if(house && house->isInvited(player)){
						return RET_NOTPOSSIBLE;
					}
				}
			}

			creature->getTile()->moveCreature(creature, toTile, true);
			return RET_NOERROR;
		}
		else if(Item* item = thing->getItem()){
			return internalMoveItem(item->getParent(), toTile, INDEX_WHEREEVER, item, item->getItemCount(), NULL, flags);
		}
	}

	return RET_NOTPOSSIBLE;
}

Problem pojawia się taki że właściciel także nie może użyć drabiny

weź wypierdol ten kawałek ze sprawdzaniem house, na chuj to komu
 
Back
Top