MCPcopy Create free account
hub / github.com/NetHack/NetHack / record_price_quote

Function record_price_quote

src/shk.c:438–448  ·  view source on GitHub ↗

Remembers that a shopkeeper has quoted a particular price for a particular type of object. */

Source from the content-addressed store, hash-verified

436/* Remembers that a shopkeeper has quoted a particular price for a
437 particular type of object. */
438void
439record_price_quote(int otyp, unsigned long price, boolean buyprice) {
440 struct objclass *oc = &objects[otyp];
441 if (buyprice) {
442 if (price > oc->oc_buy_maxseen) oc->oc_buy_maxseen = price;
443 if (price < oc->oc_buy_minseen) oc->oc_buy_minseen = price;
444 } else {
445 if (price > oc->oc_sell_maxseen) oc->oc_sell_maxseen = price;
446 if (price < oc->oc_sell_minseen) oc->oc_sell_minseen = price;
447 }
448}
449
450/* Appends price-quote information to the given buffer, updating the
451 given end of string position. *eos mut be buf + strlen(buf). If the

Callers 3

doname_baseFunction · 0.85
add_one_tobillFunction · 0.85
sellobjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected