[RELEASE] [C++] pet.is_mine-Questfunction

11/07/2015 11:17 Mr. 'Avenue™#1
Funktion:
Gibt zurück, ob du der Besitzer des Pets bist.

Benutzungs-Beispiel:
Code:
when 34001.click with pet.is_mine() begin
Code: (questlua_pet.cpp)
Code:
	int pet_is_mine(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		LPCHARACTER mch = q.GetCurrentCharacterPtr();
		LPCHARACTER tch = q.GetCurrentNPCCharacterPtr();
		CPetSystem* petSystem = mch->GetPetSystem();
		CPetActor* petActor = petSystem->GetByVID(tch->GetVID());

		lua_pushboolean(L, tch && tch->IsPet() && petActor && petActor->GetOwner() == mch);
		return 1;
	}
[Only registered and activated users can see links. Click Here To Register...]
11/07/2015 11:23 Jinbei#2
#moved…
11/07/2015 12:32 Metin2 Team#3
thanks for that.

I think that you forgot to add this line.

Code:
CPetSystem* petSystem = mch->GetPetSystem();
11/07/2015 12:34 Mr. 'Avenue™#4
Quote:
Originally Posted by Metin2 Team View Post
thanks for that.

I think that you forgot to add this line.

Code:
CPetSystem* petSystem = mch->GetPetSystem();
ofc :o Added, thank you
11/07/2015 12:39 Mi4uric3#5
Quote:
Originally Posted by Mr. 'Avenue™ View Post
Code:
	int pet_is_mine(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		LPCHARACTER mch = q.GetCurrentCharacterPtr();
		LPCHARACTER tch = q.GetCurrentNPCCharacterPtr();
		CPetSystem* petSystem = mch->GetPetSystem();
		CPetActor* petActor = petSystem->GetByVID(tch->GetVID());

		lua_pushboolean(L, tch && tch->IsPet() && petActor && petActor->GetOwner() == mch);
		return 1;
	}
ofc :o Added, thank you
If you don't use the variable afterwards, what's the point of adding it?
11/07/2015 13:28 Mr. 'Avenue™#6
Quote:
Originally Posted by Mi4uric3 View Post
If you don't use the variable afterwards, what's the point of adding it?
Es wird doch alles benutzt? :o
11/07/2015 14:03 Mi4uric3#7
Quote:
Originally Posted by Mr. 'Avenue™ View Post
Es wird doch alles benutzt? :o
Ich bin blind. Strg+F hätte vielleicht geholfen
11/07/2015 14:18 MaxChri#8
Nice hätte ich früher gebraucht, aber jetzt ist es zu spät :D