aboutsummaryrefslogtreecommitdiff
path: root/src/crmain.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-15 17:35:06 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-15 17:35:06 -0300
commit3cc587ab8df80d42d9dab1a73a37701f565a3499 (patch)
treeea10cae94a9ef7a3c9b4080746a9697287e8991b /src/crmain.cc
parent33464579f6b8b079597617593d2bb733e982db8f (diff)
downloadgame-3cc587ab8df80d42d9dab1a73a37701f565a3499.tar.gz
game-3cc587ab8df80d42d9dab1a73a37701f565a3499.zip
more work on `operate.cc`
Diffstat (limited to 'src/crmain.cc')
-rw-r--r--src/crmain.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/crmain.cc b/src/crmain.cc
index 7e0ab42..c6a8b74 100644
--- a/src/crmain.cc
+++ b/src/crmain.cc
@@ -719,9 +719,13 @@ int TCreature::Damage(TCreature *Attacker, int Damage, int DamageType){
GraphicalEffect(this->CrObject, HitEffect);
TextualEffect(this->CrObject, TextColor, "%d", Damage);
if(SplashLiquid != LIQUID_NONE){
- CreatePool(GetMapContainer(this->CrObject),
- GetSpecialObject(BLOOD_SPLASH),
- SplashLiquid);
+ try{
+ CreatePool(GetMapContainer(this->CrObject),
+ GetSpecialObject(BLOOD_SPLASH),
+ SplashLiquid);
+ }catch(RESULT r){
+ // TODO(fusion): Ignore?
+ }
}
}
@@ -754,10 +758,15 @@ int TCreature::Damage(TCreature *Attacker, int Damage, int DamageType){
if(ObjType == AmuletOfLossType){
Log("game", "%s stirbt mit Amulett of Loss.\n", this->Name);
this->LoseInventory = 0;
- Delete(Obj, -1);
- // TODO(fusion): Shouldn't we break here? We could also
- // just check if there is an amulet of loss in the necklace
- // container instead of iterating over all of them.
+ try{
+ Delete(Obj, -1);
+ // TODO(fusion): Shouldn't we break here? We could also
+ // just check if there is an amulet of loss in the necklace
+ // container instead of iterating over all inventory.
+ }catch(RESULT r){
+ error("TCreature::Damage: Exception %d beim Löschen von Objekt %d.\n",
+ r, AmuletOfLossType.TypeID);
+ }
}
}
}