[crossfire] server 1.8.0 SEGV

2005-12-30 Thread hv
(In passing: the README in the v1.8.0 server release points at:
  http://crossfire.real-time.com/Website_Index/Mailing_Lists/mailing_lists.jhtml
for the mailing lists, but a site reorganisation means it is now at:
  http://crossfire.real-time.com/mailinglists/index.html
)

Running a local server for single player use under Redhat Linux 7.1,
using v1.8.0 release of server and cfclient (under X with fvwm),
compiled with gcc 2.96, configured with:
  --prefix=/opt/crossfire-1.8.0 --with-python=/opt/python-2.4.1

The server had been up 2-3 days, and had several hours of (single player)
use in that time. I entered the first (random map) level of:
  maps/quests/peterm/quests/ogre_chief
and hit a SEGV as described below within a minute of entering.

Firing up gdb on the core file gave me:
(gdb) where
#0  monster_should_cast_spell (monster=0x908ec90, spell_ob=0x0)
at monster.c:689
#1  0x0807e32a in monster_check_apply (mon=0x908ec90, item=0x8acff6c)
at monster.c:1252
#2  0x0807e06b in monster_check_pickup (monster=0x908ec90) at monster.c:1084
#3  0x0807cc6d in move_monster (op=0x908ec90) at monster.c:329
#4  0x0809d765 in process_object (op=0x908ec90) at time.c:1312
#5  0x0807c061 in process_events (map=0x0) at main.c:1002
#6  0x0807c5bd in main (argc=1, argv=0xbbd4) at main.c:1232
#7  0x4009f1c4 in __libc_start_main () from /lib/libc.so.6
(gdb) up
#1  0x0807e32a in monster_check_apply (mon=0x908ec90, item=0x8acff6c)
at monster.c:1252
1252if (monster_should_cast_spell(mon, item->inv))
(gdb) p *item
$1 = {contr = 0x0, next = 0x8d5d2b4, prev = 0x91c8530, active_next = 0x0, 
  active_prev = 0x0, below = 0x893ba88, above = 0x0, inv = 0x0, 
  container = 0x0, env = 0x908ec90, more = 0x0, head = 0x0, map = 0x0, 
  count = 2952096, refcount = 0, name = 0x82f23fc "scroll", 
  name_pl = 0x826d384 "scrolls", title = 0x0, race = 0x826d384 "scrolls", 
  slaying = 0x0, skill = 0x827baf4 "use magic item", msg = 0x0, lore = 0x0, 
  x = 0, y = 0, ox = 0, oy = 0, speed = 0, speed_left = -0.10001, 
  nrof = 1, face = 0x81ad468, direction = 0 '\000', facing = 0 '\000', 
  type = 111 'o', subtype = 0 '\000', client_type = 661, resist = {
0 }, attacktype = 0, path_attuned = 0, 
  path_repelled = 0, path_denied = 0, material = 1, 
  materialname = 0x83d2eac "paper", magic = 0 '\000', state = 0 '\000', 
  value = 1, level = 0, last_heal = 0, last_sp = 0, last_grace = 0, 
  last_eat = 0, invisible = 0, pick_up = 0 '\000', item_power = 0 '\000', 
  gen_sp_armour = 0 '\000', weight = 200, weight_limit = 0, carrying = 0, 
  glow_radius = 0 '\000', stats = {Str = 0 '\000', Dex = 0 '\000', 
Con = 0 '\000', Wis = 0 '\000', Cha = 0 '\000', Int = 0 '\000', 
Pow = 0 '\000', wc = 0 '\000', ac = 0 '\000', hp = 0, maxhp = 0, sp = 0, 
maxsp = 0, grace = 0, maxgrace = 0, exp = 0, food = 0, dam = 0, 
luck = 0 '\000'}, perm_exp = 0, current_weapon_script = 0x0, 
  current_weapon = 0x0, weapontype = 0, tooltype = 0, 
  body_info = '\000' , 
  body_used = '\000' , owner = 0x0, ownercount = 0, 
  enemy = 0x0, attacked_by = 0x0, attacked_by_count = 4294967295, 
  randomitems = 0x0, run_away = 0, chosen_skill = 0x0, hide = 0, 
  move_status = 0, move_type = 0, will_apply = 0 '\000', spellitem = 0x0, 
  expmul = 1, duration = 0, duration_modifier = 0 '\000', casting_time = -1, 
  spell = 0x0, start_holding = 0, spellarg = 0x0, dam_modifier = 0 '\000', 
  range = 0 '\000', range_modifier = 0 '\000', arch = 0x83425a0, 
  other_arch = 0x0, flags = {0, 0, 0, 0}, animation_id = 0, 
  anim_speed = 0 '\000', last_anim = 0 '\000', elevation = 0, 
  smoothlevel = 0 '\000', events = 0x0, custom_name = 0x0}
(gdb) 

I'm happy to provide more info (or the core file) if it might help,
but I'd suggest at the least a patch as below to avoid the crash.

Hugo
--- monster.c   Sat Jul 30 09:23:27 2005
+++ monster.c   Fri Dec 30 22:07:06 2005
@@ -686,6 +686,11 @@
 
 static int monster_should_cast_spell(object *monster, object *spell_ob)
 {
+/* sanity check */
+if (spell_ob == NULL) {
+   LOG(llevError, "monster_should_cast_spell: spell_ob is NULL\n");
+   return 0;
+}
 if (spell_ob->subtype == SP_BOLT || spell_ob->subtype == SP_BULLET ||
spell_ob->subtype == SP_EXPLOSION || spell_ob->subtype == SP_CONE ||
spell_ob->subtype == SP_BOMB || spell_ob->subtype == SP_SMITE ||

___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


[crossfire] shops and stealing

2005-12-30 Thread Mark Wedel


 For a long time, the thief skill stealing has been available, but the only use 
was the limited ability to steal from monsters.


 With the addition of new fields in the map header for shops, it'd seem like it 
would not be possible to extend stealing to shops.  Not that the current headers 
are really in any way useful, but in a sense, because they sort of give an 
example of extending the shop attributes.


 What I'd suggest then is fields like:

steal_adjustment:  Represents how hard/easy it is to steal from this shop.  A 
positive value denotes it is easy, negative value means it is hard.


max_steal_value: Maximum value of an object that can be stolen from this store. 
 Thus, if someone drops a 10,000 pp item in a shop easy to steal from (which 
normally has junky stuff), one wouldn't be able to steal it, because this value 
for the shop may be something like 10 pp.


jail_map:  If the theif is caught, map where they are sent.  At least scorn has 
a jail if I recall - not sure if other maps.  But basically, get caught 
stealing, have to sit around for 5 (or more) minutes.  Easier shops would 
probably sentence you to less time.   This could be in the form of [EMAIL PROTECTED],y 
to denote coordinates to put the player into.


 If you succeed, you get exp based on the value of the object as well as actual 
difficulty of the attempt.


 For difficulty, I would say it should be based on the weight of the object (we 
don't have a size, but generally these two are somewhat related).  Harder to 
steal a suit of plate armor than a ring.  But the value of the object should 
also have an adjustment - that shopkeeper is going to keep a closer eye on those 
expensive items.


 Also, stealing would only be allowed if some of those fields exist (maybe 
jail_map - allowing stealing on a map with no penalty seems like a bad idea, but 
I could certainly see steal_adjustment being zero and max_steal_value also not 
being set (but probably not on the same map)).


 I'd also add that no matter how good a thief the person is, there should 
always be some chance of being caught (a fumble) - since I think chances are 
percentage based, this could be 1% chance.  Thus, in a sense, a player that 
tries to steal a lot as an alternative to adventuring for exp could do so, but 
is going to get caught now and again and have to spend time in jail.


 As for stealing, it may be easiest to have something like 'steal inventory' 
command, which attempts to steal the unpaid items currently in your inventory. 
If you succeed, the unpaid flag is cleared, if fail, go to jail.  Probably limit 
it to 1 item per try just to reduce rate of stealing.


 thoughts?



___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] Re: I'll commit the large denomination coin archtypes, I'd like to edit the amber coin to look more ambery (any objections)?

2005-12-30 Thread Mark Wedel

Lalo Martins wrote:

Local currencies
=


 As a note, while having local currencies add flavors, I'm not really sure if 
it is worth the complication/confusion it is likely to cause.  This will likely 
be somewhat related to how many regions we have.  But one can certainly see a 
case where a player becomes a citizen of a new region and is now really confused 
on those values.




The player needs to have a field or force saying his region of
citizenship.  This would be used for appraisals.  To do this, in the
hall where you select starting city, the exits would be replaced with
player changers (and the code needs to be updated to handle this new
type of player changer).





When you sell something at a store, it would pick the coins to give you
from the region's money.


 To me, it would probably make more sense, but perhaps be more confusing, to 
get appraisals based on the region you are in.  It perhaps seems a bit odd be in 
a shop, examining your objects, and being told it is worth 5 pp, 2 gp, but when 
you sell it, you get 2 amber coins & 2 copper ingots or something.




UNDECIDED: shops may either accept any and all money (easy to do -
instead of iterating over a list of money archs, it iterates over the
money archs in the player's inventory), or they may accept only region
money, forcing you to go to the bank first.  Thoughts?  If we go with
the second, then "tourist-friendly" shops can have converters in a corner.


 Having to convert money to me just seems a bother (find I nice item in a shop 
I want to buy.  Oh, I'm in pupland, have to leave the shop, find a bank, convert 
the right amount over, etc).  And if the conversion isn't 1:1 (eg, the bank 
takes some percentage for service), then it becomes even more a pain, because 
you don't really want to convert more you need.  You'd also perhaps get the the 
case that gems become the most stable money, presuming you can still sell them 
in the shops and get whatever money.




Monster treasure would also pick from the region money, although I
suppose we could allow a money field in the map too, if you want a map
to give funny money.


 Note that right now, treasurelists are coded with actual coin types, and not a 
'money' type.  So making this change requires some mucking with the treasure 
generation code, and could be relatively complicated especially if the different 
regions don't have that 10:1 ratio (eg, region the uses copper, silver, gold, 
and platinum ningis, with 7:1 for each ration (copper ningi has base value 1, 
silver ningi 7, gold 49, platinum 343).  Converting what as 500 gp now becomes 1 
platinum, 3 gold, 1 silver, 3 copper ningis).


 If this change is made, I'd suggest all treasurelists need to be updated to 
have a 'money' metatype, with the nrof representing the total value of the 
goods.  Any treasurelists that specifically mention coin types would use those 
coin types.


 That said, throwing in the odd foreign currency in a dungeon would make things 
interesting.  Imagine those low level players adventuring around scorn and 
finding some ningis and asking what the heck are those.




Then it's all fun... I'd suggest getting rid of the existing
gold/silver/plat "generic" coins and replacing them with non-coined
pieces (which probably explains their relatively low value).  Then
introducing the "scorn penny", "scorn shilling", "scorn pound", "navar
cent", "navar dime", "navar dollar", "pupland marks", and so on ad
infinitum.


 Not until relative recent history did paper money really become popular.  That 
said, if currency is changed, I'd suggest unique graphics (that are clearly 
distinguishable) are probably desired - having bunches of coins in my inventory 
that all look the same would be confusing/annoying, and remove some of the 
reason for doing this, which is to add character.


 That said, one could make some changes fairly simply - one region could use 
triangular 'coins' instead of round ones.  Also, if the face was replaced by 
just a single large coin (vs the stack like there is now), this would allow more 
detail to be put into the image - perhaps even enough to put different images on 
the coin face itself.  After all, for most all other objects, each imagine 
represents just one of that image, and not a pile.




This can also support mwedel's notion of accepting gems as money, by
simply stating in the appropriate code that type GEM is as acceptable as
type MONEY.  So if shops accept foreign currency, they will also accept
gems; if they don't, you'll be able to put gems in the money field for a
region or map.  (Carrying gems would then be a good strategy when going
to a new country - you'll never know if they have exchange service for
the money you have...)


 As a note, I'd think any decent sized place (large enough to have its own 
currency) should have a bank to convert the currency.  Simply because if it 
doesn't, this adds more bother (shoot, can't convert from navar dollars to 
ningis 

Re: [crossfire] Wraith changes

2005-12-30 Thread Mark Wedel

Anton Oussik wrote:


Another thing that could be done is to reduce the feding speed. What
is the proper way of reducing weapon speed of a skill? I looked around
briefly, but could not find it.


 I don't know if there is actually a way to do this - it may be hardcoded right 
now, but there must be some diffrence, as I know karate is faster than dragon 
clawing even at the same level.





  If so, I wonder if it may be nice to give starting wraiths some like a staff
of minor healing just so they can use it to get enough hp to go kill wimpy
things.


As it stands now, a newborn wraith at 0hp can quite happily clear a
room of kobolds and come out with full hp. I feel it is too powerful,
so perhaps doing both, scaling down the feeding speed (probably about
5-10fold), and also not giving the wraith the skill until they reach
level 15 would be appropriate to balance the race.


 Well, I'd argue that if I can go into a room with 0 hp and be sure to survive 
fighting kobolds, something is a bit off.


 but my original point was also that if I'm at 0 (or near zero hp) and low 
level, what can I do?  Arguably, fighting anything should have some danger, and 
given that hp level, a stray hit could kill me.  Yet if I don't get hp back by 
waiting, I'm sort of stuck - I basically have to risk death to get the hp back.


 I wonder if level should also come into play?  I could otherwise see more 
moderate level wraiths who have very few hp thinking 'hey, I should go to the 
newbie dungeon to suck up some hp', which probably isn't what we really want. 
That 8th level wraith probably shouldn't get nearly as many hp back fighting 
kobolds if we want to try and discourage that behaviour.





___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire



___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire