# Gas pumps and firethrowers

**URL:** <https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042>\
**Category:** The Garage\
**Created:** [April 28, 2013, 4:15am UTC](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042 "2013-04-28T04:15:15Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Flare](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@Flare](https://discourse.cataclysmdda.org/u/Flare)\
**Post date:** [April 30, 2013, 5:13am UTC](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042/21 "2013-04-30T05:13:36Z")

</div>

> [@KA101](#):
>
> Probably no maintenance, pump locks out for nonpayment (electrohack to the rescue!), or something like that.

8 hours of no maintenance seems a tad unreasonable for a pump breaking.

And accessing the gas would be simple enough, there are credit cards all over the corpses no? And even if the remote servers that accepts cards aren’t working. You could always just go inside behind the cashier’s stand and manually open the locks.

> Though if you want to get hyper-technical, gas pumps don't have backup power...so they shouldn't be operational at all.

Actually, some gas stations do have emergency back up generators. Some countries even make it a requirement due to how important fuel is in a time of emergency, cataclysm, or otherwise an event that causes widespread and long term power outage.

---

<div class="post-metadata">

**Author:** ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Post date:** [April 30, 2013, 6:24pm UTC](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042/22 "2013-04-30T18:24:55Z")

</div>

> [@Flare](#):
>
> Actually, some gas stations do have emergency back up generators. Some countries even make it a requirement due to how important fuel is in a time of emergency, cataclysm, or otherwise an event that causes widespread and long term power outage.

Quite a few cities in the New England area (which is where cataclysm takes place) are now requiring all gas stations to have backup power. It’s not too far of a stretch to assume that that trend continued to require all gas stations to have backup power for the pumps.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [April 30, 2013, 7:55pm UTC](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042/23 "2013-04-30T19:55:52Z")

</div>

When I added the chance for pumps to run dry, there were no large containers for fuel, and I haven’t been able to get around to fixing it since. I’ve actually tried several times, but the code for handling liquids is a spagettified mess and is highly resistant to doing anything sensible. It’s definitely on the list of things to fix. Btw, if you ever wonder why devs complain so much about messy code, this is the reason, I’ve literally put multiple _hours_ in trying to make this fix, and haven’t been able to get it working so far.

Re: random chance vs random amount of fuel that runs out at a rate based on how much fuel is dispensed, unless we added a fuel gauge to the fuel pumps, or added the ability to ADD gasoline to the pumps, there is literally no discernable difference between the two approaches, and generating the amount of fuel up front requires us to then STORE that fuel level for every fuel pump. Due to the way the code is structured right now, this would actually require us to store “fuel level” for every square of terrain in the game, which is um, a bad idea.

---

<div class="post-metadata">

**Author:** ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Post date:** [April 30, 2013, 8:02pm UTC](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042/24 "2013-04-30T20:02:36Z")

</div>

Yeah I was looking at the code for most of yesterday and came to about the same conclusion that adding a “bonus data” storage spot for every single piece of terrain in the game was a bad idea. The whole thing is a mess, and it doesn’t lend itself to nice solutions well at all (really what we need is a total rewrite, but it’s difficult to tell exactly what you might break if you do so.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [April 30, 2013, 8:35pm UTC](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042/25 "2013-04-30T20:35:08Z")

</div>

I have a git stash where I have handle\_liquid() partially converted to return the amount of liquid handled rather than just “handled it”/“didn’t handle it”, with that conversion done I can base the chance of the pump running out on the amount pumped rather than it being flat for any container.

That leaves a pretty big problem, it’s still instantaneous (ok, 6 seconds) to fill any discrete container you care to use 😛

Anyway, I keep wacking away at the bad code.

[Previous page](https://discourse.cataclysmdda.org/t/gas-pumps-and-firethrowers/1042.md?page=1)
