L2JMobius

Interlude I think I found the problem with the quest Q00419_GetAPet.

RootShell · 6 · 373

Offline RootShell

  • Heir
  • **
    • Posts: 12
final int proofs has the type int, but the types being added are long. I'm not completely sure about this, but when I tried to use this quest in classic interlude, it caused a type error.

Please check this first.

Code: [Select]
--- Q00419_GetAPet.java 2025-09-18 15:02:22.639679000 +0300
+++ Q00419_GetAPet_corr.java 2025-09-18 15:04:19.756551700 +0300
@@ -191,7 +191,7 @@
  {
  if (hasAtLeastOneQuestItem(player, ANIMAL_SLAYER_LIST_1, ANIMAL_SLAYER_LIST_2, ANIMAL_SLAYER_LIST_3, ANIMAL_SLAYER_LIST_4, ANIMAL_SLAYER_LIST_5))
  {
- final int proofs = getQuestItemsCount(player, BLOODY_FANG) + getQuestItemsCount(player, BLOODY_CLAW) + getQuestItemsCount(player, BLOODY_NAIL) + getQuestItemsCount(player, BLOODY_KASHA_FANG) + getQuestItemsCount(player, BLOODY_TARANTULA_NAIL);
+ final int proofs = (int)(getQuestItemsCount(player, BLOODY_FANG) + getQuestItemsCount(player, BLOODY_CLAW) + getQuestItemsCount(player, BLOODY_NAIL) + getQuestItemsCount(player, BLOODY_KASHA_FANG) + getQuestItemsCount(player, BLOODY_TARANTULA_NAIL));
  if (proofs == 0)
  {
  htmltext = "30731-09.htm";


thx



Offline RootShell

  • Heir
  • **
    • Posts: 12
No.

final int proofs

I’m using type casting to int after adding the values.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19715

Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
final int proofs has the type int, but the types being added are long. I'm not completely sure about this, but when I tried to use this quest in classic interlude, it caused a type error.

Please check this first.

Code: [Select]
--- Q00419_GetAPet.java 2025-09-18 15:02:22.639679000 +0300
+++ Q00419_GetAPet_corr.java 2025-09-18 15:04:19.756551700 +0300
@@ -191,7 +191,7 @@
  {
  if (hasAtLeastOneQuestItem(player, ANIMAL_SLAYER_LIST_1, ANIMAL_SLAYER_LIST_2, ANIMAL_SLAYER_LIST_3, ANIMAL_SLAYER_LIST_4, ANIMAL_SLAYER_LIST_5))
  {
- final int proofs = getQuestItemsCount(player, BLOODY_FANG) + getQuestItemsCount(player, BLOODY_CLAW) + getQuestItemsCount(player, BLOODY_NAIL) + getQuestItemsCount(player, BLOODY_KASHA_FANG) + getQuestItemsCount(player, BLOODY_TARANTULA_NAIL);
+ final int proofs = (int)(getQuestItemsCount(player, BLOODY_FANG) + getQuestItemsCount(player, BLOODY_CLAW) + getQuestItemsCount(player, BLOODY_NAIL) + getQuestItemsCount(player, BLOODY_KASHA_FANG) + getQuestItemsCount(player, BLOODY_TARANTULA_NAIL));
  if (proofs == 0)
  {
  htmltext = "30731-09.htm";


thx
Classic interlude is discontinued. That's first and second as mobius say add cast to int is wrong is the original is long


Offline RootShell

  • Heir
  • **
    • Posts: 12
 :) ок

int 32 = 4 bit
-2,147,483,648 - 2,147,483,647

long 64 = 8 bit

-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807

Nobody saves memory. ok, ok


Upd

Classic Interlude is discontinued, but this isn't about it — it's about the quest and the issue I encountered. And I don't know which is more resource-efficient: casting the type to int or leaving it as long. The garbage collector will eventually come and clean everything up anyway.