Unwirksame Casts gefixt.
Change-Id: I769baa53d4d9fe1720717bc1817635980fa6ff08
diff --git a/std/container/restrictions.c b/std/container/restrictions.c
index b9dcbf9..294d7a7 100644
--- a/std/container/restrictions.c
+++ b/std/container/restrictions.c
@@ -87,8 +87,8 @@
i = sizeof(objs);
while ( i-- ){
- if ( !(w2 = (int)objs[i]->QueryProp(P_TOTAL_WEIGHT)) )
- w2 = (int)objs[i]->QueryProp(P_WEIGHT);
+ if ( !(w2 = ({int})objs[i]->QueryProp(P_TOTAL_WEIGHT)) )
+ w2 = ({int})objs[i]->QueryProp(P_WEIGHT);
w += w2;
}
@@ -146,7 +146,7 @@
// Wenn das Objekt ein env() hochbewegt wird, wird das Gewicht im alten
// Container abgezogen. Weiterer Check im env() ist unnoetig (aw=0).
if ( ENV(ENV(PO)) == ME )
- nw = w - (int)ENV(PO)->QueryProp(P_WEIGHT_PERCENT) * w / 100;
+ nw = w - ({int})ENV(PO)->QueryProp(P_WEIGHT_PERCENT) * w / 100;
// Eine Ebene tiefer bewegen: Test im neuen Container mit unveraendertem
// Gewicht; Check im env() mit um Gewichtsreduktion verringertem Gewicht
else if ( present( ME, ENV(PO) ) )
@@ -156,7 +156,7 @@
// Differenz aus Gewicht in Container1 und in Container2.
else if ( ENV(ENV(ENV(PO))) && ENV() == ENV(ENV(PO)) )
aw = QueryProp(P_WEIGHT_PERCENT) * w / 100
- - ((int)ENV(PO)->QueryProp(P_WEIGHT_PERCENT) * w / 100 || 1);
+ - (({int})ENV(PO)->QueryProp(P_WEIGHT_PERCENT) * w / 100 || 1);
}
if ( query_weight_contents() + nw > QueryProp(P_MAX_WEIGHT) )
@@ -193,7 +193,7 @@
// Hilfsfunktion
static int _behalten( object ob, string uid )
{
- return (string)ob->QueryProp(P_KEEP_ON_SELL) == uid;
+ return ({string})ob->QueryProp(P_KEEP_ON_SELL) == uid;
}
@@ -482,7 +482,7 @@
object *found_obs = ({});
foreach(object invob: present_objects(wo)) {
// || ({}) weil invob ein Objekt ohne locate_objects() sein koennte.
- found_obs += (object *)invob->locate_objects( was, info) || ({});
+ found_obs += ({object*})invob->locate_objects( was, info) || ({});
}
return found_obs;
}
diff --git a/std/thing/language.c b/std/thing/language.c
index 9e0a0a6..9ec70af 100644
--- a/std/thing/language.c
+++ b/std/thing/language.c
@@ -36,7 +36,7 @@
return ({ ({ "das ", "des ", "dem ", "das " }),
({ "der ", "des ", "dem ", "den " }),
({ "die ", "der ", "der ", "die " }) })
- [(int)QueryProp(P_GENDER)][casus];
+ [({int})QueryProp(P_GENDER)][casus];
}
// Ende fuer Artikel und Adjektive
@@ -61,7 +61,8 @@
// Objekt mit gleichem Namen im env? Dann unbestimmt
for ( ob=first_inventory(environment()) ; ob ; ob=next_inventory(ob) )
- if ( ob!=this_object()&& id==(string)ob->QueryProp(P_NAME) )
+ if ( ob!=this_object()
+ && id == ({string})ob->Name(RAW) )
return 0;
// sonst bestimmt
@@ -83,7 +84,7 @@
// Unbestimmter Artikel
if (QueryProp(P_PLURAL)) return "";
- return sprintf("ein%s ",query_g_suffix((int)QueryProp(P_GENDER),casus));
+ return sprintf("ein%s ",query_g_suffix(({int})QueryProp(P_GENDER),casus));
}
// Besitzanzeiger fuer Objekt bestimmen
@@ -93,17 +94,17 @@
}
// Possessivpronomen bestimmen
-public varargs string QueryPossPronoun(mixed what, int casus, int number)
+public varargs string QueryPossPronoun(int|object what, int casus, int number)
{
int gen2;
// Geschlecht ermitteln
- gen2 = (objectp(what)?(int)what->QueryProp(P_GENDER):(int)what);
+ gen2 = (objectp(what)?({int})what->QueryProp(P_GENDER):what);
// Plural ist schoen einfach
if (QueryProp(P_PLURAL)) return "ihr"+query_g_suffix(gen2, casus, number);
- return (((((int)QueryProp( P_GENDER ))==FEMALE )? "ihr":"sein")+
+ return ((((({int})QueryProp( P_GENDER ))==FEMALE )? "ihr":"sein")+
query_g_suffix(gen2%3, casus, number));
}
@@ -151,7 +152,7 @@
// Welches Geschlecht hat das Objekt als String?
public string QueryGenderString()
{
- switch( (int)QueryProp( P_GENDER ))
+ switch( ({int})QueryProp( P_GENDER ))
{
case MALE: return "maennlich";
case FEMALE: return "weiblich";
@@ -183,12 +184,12 @@
return adj + ({ ({ "e " , "en ", "en ", "e " }),
({ "e " , "en ", "en ", "en " }),
({ "e " , "en ", "en ", "e " }) })
- [(int)QueryProp( P_GENDER )][casus];
+ [({int})QueryProp( P_GENDER )][casus];
else
return adj + ({ ({ "es ", "en ", "en ", "es " }),
({ "er ", "en ", "en ", "en " }),
({ "e " , "en ", "en ", "e " }) })
- [(int)QueryProp( P_GENDER )][casus];
+ [({int})QueryProp( P_GENDER )][casus];
}
// P_GENDER setzen. Es sind nur 0,1 und 2 (MALE,FEMALE,NEUTER) erlaubt