thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Is the FakeClient suicide function bugged?  (Read 922 times)

Offline soothaa

  • Newbie
  • *
  • Posts: 9
Is the FakeClient suicide function bugged?
« on: January 15, 2015, 06:49:03 PM »
Or am I just using it wrong?

Code: [Select]
joe.suicides()

Code: [Select]
Joe kills himself
Traceback (most recent call last):
  File "C:\Users\Administrator\Dropbox\b3_btc\btc.py", line 147, in <module>
    joe.suicides()
  File "C:\python27\lib\site-packages\b3-1.9.2-py2.7.egg\b3\fake.py", line 376, in suicides
    self, victim))
NameError: global name 'victim' is not defined

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Is the FakeClient suicide function bugged?
« Reply #1 on: January 15, 2015, 08:22:17 PM »
There is a bug in the fake.suicides() function in B3 v1.9.2, the correct code should be

Code: python [Select]

    def suicides(self):
        print "\n%s kills himself" % self.name
        self.console.queueEvent(b3.events.Event(b3.events.EVT_CLIENT_SUICIDE,
                                                       (100, 1, 1, 1),
                                                       self, self))

Offline soothaa

  • Newbie
  • *
  • Posts: 9
Re: Is the FakeClient suicide function bugged?
« Reply #2 on: January 16, 2015, 02:39:06 PM »
Thanks, the way I fixed it was removing the entire ", victim" part and did not add "self" in.

 


Rate this page +1 at Google Search

anything