Skip to content

Commit 640429f

Browse files
committed
Merge branch 'gonzobot' of github.com:snoonetIRC/CloudBot into gonzobot
2 parents 7ba6581 + 27615fe commit 640429f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugins/duckhunt.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,10 @@ def update_score(nick, chan, db, conn, shoot=0, friend=0):
281281
.where(table.c.name == nick.lower())).fetchone()
282282
if score:
283283
dbupdate(nick, chan, db, conn, score[0] + shoot, score[1] + friend)
284+
return {'shoot': score[0] + shoot, 'friend': score[1] + friend}
284285
else:
285286
dbadd_entry(nick, chan, db, conn, shoot, friend)
287+
return {'shoot': shoot, 'friend': friend}
286288

287289

288290
def attack(nick, chan, message, db, conn, notice, attack):
@@ -355,13 +357,12 @@ def attack(nick, chan, message, db, conn, notice, attack):
355357

356358
status['duck_status'] = 2
357359
try:
358-
score = 1
359360
args = {
360-
attack_type: score
361+
attack_type: 1
361362
}
362363

363-
update_score(nick, chan, db, conn, **args)
364-
except DatabaseError:
364+
score = update_score(nick, chan, db, conn, **args)[attack_type]
365+
except Exception:
365366
status['duck_status'] = 1
366367
raise
367368

0 commit comments

Comments
 (0)