Opened 9 years ago

Closed 9 years ago

#852 closed bug (fixed (in master))

Torches of Brightness description wrong

Reported by: magnate Owned by: takkaria
Milestone: 3.1.1 beta Keywords: id
Cc:

Description

Description says light radius 2, but they actually have radius 3.

Change History (17)

comment:1 Changed 9 years ago by magnate

  • Resolution set to worksforme
  • Status changed from new to closed

Er, no. Description is actually fine. No idea what the problem was - possibly an old compile.

comment:2 Changed 9 years ago by magnate

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Ok, this is actually a bug. I bought a Torch of Brightness in the BM, and it says "radius 3 light". Pete found one dropped by a monster, and it says "radius 2 light" (even though it shines with radius 3). We ran the inspect command (I/f) through gdb, and it turns out that his is not known, hence the PLITE flag is not known, and not counted in the description. He cannot ID it ("you have nothing to identify"). So it's actually an ID bug - torches bought in stores are fully IDd, but dropped torches are not ...

comment:3 Changed 9 years ago by magnate

I think this could be solved by adding EASY_KNOW either to the Of Brightness ego, or to TR2_OBVIOUS_MASK - but I don't think either of those is how it's supposed to work ...

comment:4 follow-up: Changed 9 years ago by noz

It's coming from object_info_out() in object/obj_info.c, where this snippet of code is:

	bool known = object_known_p(o_ptr);
	
	/* Grab the object flags */
	if (full)
		object_flags(o_ptr, f);
	else
		object_flags_known(o_ptr, f);

known is true, as the base object has EASY_KNOW, but then the only flags that get loaded are zero, since this object has nothing apart from its kind and ego flags.

I think it should be if (full || known), but I want a second opinion, before that breaks something else!

comment:5 in reply to: ↑ 4 Changed 9 years ago by magnate

Replying to noz:

known is true, as the base object has EASY_KNOW, but then the only flags that get loaded are zero, since this object has nothing apart from its kind and ego flags.

Why isn't TR2_LITE being loaded at this point?

I think it should be if (full || known), but I want a second opinion, before that breaks something else!

I don't think that's right. The code you posted should return the LITE flag. The fact that it doesn't is a bug - the object *does* have the LITE flag, as we know from the code in calcs.c

comment:6 Changed 9 years ago by noz

Sorry I wasn't clearer.
The object itself has no flags set. When the object is known about, and object_flags() is called, what gets returned as the flags is the kind flags + the artifact flags, if any + the ego flags, if any + the object's own flags.
When the object isn't known about, object_flags_known() just copies the known_flags[] from the object itself (0 in this case)

The object itself doesn't have the TR2_LITE flag. The ego-type does. The *effective* flags, as gathered by object_flags() in calcs.c does have the TR2_LITE flag set.

comment:7 Changed 9 years ago by magnate

  • Owner changed from magnate to takkaria
  • Status changed from reopened to assigned
Right, so this is a genuine bug. Items with EASY_KNOW should return all the flags, not just known_flags[]. So I think your suggested fix is correct - if (full
known) ...

But as this is essentially an ID bug, I'll leave it to Takkaria/Eddie? to make ...

(I think ego light sources are the only ego types whose base items have EASY_KNOW - which is why we've not come across this bug before)

comment:8 Changed 9 years ago by magnate

  • Keywords id added

(sorry, forgot to tag as id)

comment:9 Changed 9 years ago by noz

Torches of brightness also don't show up as PLite in the player flags, since again known_flags doesn't have anything in.

I suggest that the real fix for this is to make sure that at object creation the object flags inherit all of the properties of the other flags. Then for those with EASY_KNOW, they are all copied to known_flags as well.

comment:10 Changed 9 years ago by magnate

We've been looking at this the wrong way. Now that we have introduced ego lights, torches and lanterns should have the EASY_KNOW flag removed! Then they will be treated like any other wearable item capable of having an ego type - namely that flags will be learned as and when. LITE is an obvious flag, and will be learned instantly - and if only one ego type has the LITE flag, it'll be fully IDd. If more than one ego type has LITE (which I expect will be the case eventually), more testing will be necessary before the ego type is fully IDd.

comment:11 Changed 9 years ago by takkaria

I'm basically hoping that Eddie's changes will fix just by virtue of them generally fixing use-ID. I'm generally in favour of keeping EASY_KNOW on lights, because it makes life just a bit easier (having to wield every torch to see if it's ego or not is tedious and will prevent stacking).

comment:12 Changed 9 years ago by magnate

One possibility is to allow fuel to stack like wand & staff charges ...

comment:13 Changed 9 years ago by takkaria

  • Status changed from assigned to confirmed

comment:14 Changed 9 years ago by takkaria

  • Owner takkaria deleted
  • Status changed from confirmed to assigned

comment:15 Changed 9 years ago by takkaria

  • Status changed from assigned to confirmed

comment:16 Changed 9 years ago by takkaria

  • Owner set to takkaria
  • Status changed from confirmed to assigned

comment:17 Changed 9 years ago by takkaria

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.