]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/gameserv.cpp
updated changes
[irc/gameservirc.git] / gameserv / gameserv.cpp
index 35d32b46a041621fd119c938f8c15e161e8fb69b..218eefe5adad8587a0714ce4cef13ded577d7c2e 100644 (file)
@@ -168,6 +168,8 @@ void gameserv(char *source, char *buf)
     if (curday != day)
     {
         refreshall();
+       clearNews(todaysnews);
+       saveNews(newsdata, todaysnews);
         day = curday;
        save_day(); // here i come to save the day!
     }
@@ -1355,9 +1357,20 @@ void do_use(char *u)
            return;
        }
        int oldhealing = user->stats->hp;
+       user->stats->hp += (10 * user->stats->level) + (rand() % 10) * user->stats->level;
+       if (user->stats->hp - user->stats->maxhp >= 100)
+       {
+           user->stats->hp = user->stats->maxhp + 100;
+
+           if (oldhealing >= (user->stats->maxhp + 100))
+           {
+               notice(s_GameServ, u, "You cannot hold anymore HP!");
+               return;
+           }
+       }
+
        notice(s_GameServ, u, "You hastiliy gulp down the flask of cool life-giving waters.");
        notice(s_GameServ, u, "Rejuvination spreads throughout your body.");
-       user->stats->hp += (10 * user->stats->level) + (rand() % 10) * user->stats->level;
        notice(s_GameServ, u, "You gain %d HP!", user->stats->hp - oldhealing);
        p->decHealing();
        if (player_fight(user))