]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/resources.qc
GetResourceAmount --> GetResource, SetResourceAmount --> SetResource
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / resources.qc
index b894d6d1f74fab6af9726230d62154e57c7b9e5c..4ff31c3c066e191341a231836075eebc683c84a9 100644 (file)
@@ -71,14 +71,14 @@ float GetResourceLimit(entity e, int res_type)
        return limit;
 }
 
        return limit;
 }
 
-float GetResourceAmount(entity e, int res_type)
+float GetResource(entity e, int res_type)
 {
        return e.(GetResourceField(res_type));
 }
 
 {
        return e.(GetResourceField(res_type));
 }
 
-void SetResourceAmount(entity e, int res_type, float amount)
+void SetResource(entity e, int res_type, float amount)
 {
 {
-       bool forbid = MUTATOR_CALLHOOK(SetResourceAmount, e, res_type, amount);
+       bool forbid = MUTATOR_CALLHOOK(SetResource, e, res_type, amount);
        if (forbid)
        {
                return;
        if (forbid)
        {
                return;
@@ -122,7 +122,7 @@ void GiveResource(entity receiver, int res_type, float amount)
        {
                return;
        }
        {
                return;
        }
-       SetResourceAmount(receiver, res_type, GetResourceAmount(receiver, res_type) + amount);
+       SetResource(receiver, res_type, GetResource(receiver, res_type) + amount);
        switch (res_type)
        {
                case RES_HEALTH:
        switch (res_type)
        {
                case RES_HEALTH:
@@ -166,7 +166,7 @@ void GiveResourceWithLimit(entity receiver, int res_type, float amount, float li
        {
                return;
        }
        {
                return;
        }
-       float current_amount = GetResourceAmount(receiver, res_type);
+       float current_amount = GetResource(receiver, res_type);
        if (current_amount + amount > limit && limit != RES_LIMIT_NONE)
        {
                amount = limit - current_amount;
        if (current_amount + amount > limit && limit != RES_LIMIT_NONE)
        {
                amount = limit - current_amount;
@@ -191,7 +191,7 @@ void TakeResource(entity receiver, int res_type, float amount)
        {
                return;
        }
        {
                return;
        }
-       SetResourceAmount(receiver, res_type, GetResourceAmount(receiver, res_type) - amount);
+       SetResource(receiver, res_type, GetResource(receiver, res_type) - amount);
 }
 
 void TakeResourceWithLimit(entity receiver, int res_type, float amount, float limit)
 }
 
 void TakeResourceWithLimit(entity receiver, int res_type, float amount, float limit)
@@ -212,7 +212,7 @@ void TakeResourceWithLimit(entity receiver, int res_type, float amount, float li
        {
                return;
        }
        {
                return;
        }
-       float current_amount = GetResourceAmount(receiver, res_type);
+       float current_amount = GetResource(receiver, res_type);
        if (current_amount - amount < -limit)
        {
                amount = -limit + current_amount;
        if (current_amount - amount < -limit)
        {
                amount = -limit + current_amount;